An NSArray
or NSMutableArray
can only hold objects, not primitive data types such as int
s. So if you want to add them to the array, you'll have to wrap them in an NSNumber
. You can do the following:
[resultArray addObject:@(i)];
This is equivalent to doing:
[resultArray addObject:[NSNumber numberWithInt:i]];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…