views:

229

answers:

1

Is it true that you can't have an NSMutableArray of NSIntegers? When I try to add the values to the array and then print them out they're huge numbers (when if I print out the tag to NSLog they're 0,1,2,3 etc.).

I'm trying to create an array of my UITabBarItem's tags so I can save the order and retrieve it later. Am I forced to do some conversion to an NSNumber to store into the array and then convert back on launch to get the integer value?

Thanks for the help.

+1  A: 

That is correct, you need to "box" them inside of NSNumbers before adding them to an NSMutableArray, you can do [array addObject:[NSNumber numberWithInt:item.tag]];

Elfred