开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜