views:

149

answers:

1

hello,
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];
A: 

Hello,

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.

Mr-sk
thank you, it help me.
dani_au