iphone code - objectAtIndex question
what doe's the upper objectAtIndex used for?, it seems to work with any开发者_如何转开发 number, why?
AppRecord *appRecord = [self.entries objectAtIndex:1];
[[[[[self tabBarController] tabBar] items] objectAtIndex:1] setBadgeValue:appRecord.badgePrize];
Typically an array or list includes entries, indexed by an integer. When you send the message
objectAtIndex:<integer>
It will return the object for the given index from the array. It might be working with many different numbers in your case, but if you attempt to return an object from an index that does not exist, the method will throw an exception.
精彩评论