如何在NSNumber中添加文字?我找不到解决方案来解决这个问题。你好吗?
NSString *myInt = interestRate.text;
NSArray *vals = [NSArray arrayWithObjects:
[NSNumber numberWithInt:30],
[NSNumber numberWithInt: [NSString stringWithFormat:@"%@", myInt]],
[NSNumber numberWithInt:20],
[NSNumber numberWithInt:56],
[NSNumber numberWithInt:70],
[NSNumber numberWithInt:34],
[NSNumber numberWithInt:43],
nil];
我无法在每个文章中添加文字。
答案 0 :(得分:1)
使用:
NSString *myInt = interestRate.text;
NSArray *vals = [NSArray arrayWithObjects:
[NSNumber numberWithInt:30],
[NSNumber numberWithInt:[myInt intValue]],
[NSNumber numberWithInt:20],
[NSNumber numberWithInt:56],
[NSNumber numberWithInt:70],
[NSNumber numberWithInt:34],
[NSNumber numberWithInt:43],
nil];