I need to store some integer values as the contents of an array. But when i try to do so, it throws a warning,
passing argument 1 of ‘addObject’ makes pointer from integer without a cast.
And obviously the value is not stored in the array.
Here’s thecode.
NSUInteger i;
for (i=0;i<5;i++){
[array addObject:i];}
NSArray-s cannot store non-idobjects. You have to box it into anNSNumber:or use a
CFArraywith custom callbacks (but you sacrifice readability for performance), or usestd::vector<NSUInteger>(but you need to use Objective-C++).