开发者

NSArray of UIBarButtonItem Tag (i.e. NSInteger)

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 th开发者_JAVA技巧ey'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.


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]];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜