我想在NSString之后输入类型为整数,我尝试了多项但不工作:
Nsstring *myString = @"123456 | 2333444 | 33333 | 3555";
答案 0 :(得分:0)
尝试以下方法:
NSString *myString = @"123456 | 2333444 | 33333 | 3555";
NSArray *numbers = [myString componentsSeparatedByString:@"|"];
for(NSString *number in numbers)
NSLog(@"%d",[number intValue]);