, ...
. , - , eJames, .
, . / :
for (NSArray *items in PlayerItems)
[[items objectAtIndex:0U] setKind:newKind];
:
for (Player *player in players)
[player setKind:newKind];
?
, , , , , . , Mac, , Bindings AppleScript ( , ) .
eJames, . Cocoa.
pgb, Cocoa ( C, ) 0. , , , , ; . .
pgb , addObject: - , void, NSMutableArray *. , ? , , , , :
Player *player = [[Player alloc] init];
for (int kind = 1; kind < 50; ++kind) {
Item *item = [[Item alloc] init];
[item setKind:kind];
[player addInventoryObject:item];
[item release];
}
[allPlayers addObject:player];
[player release];
: -. , , , , , , , .., . :
for (ItemKind *kind in [self kindsOfItems]) {
Item *item = [[Item alloc] initWithKind:kind];
[player addInventoryObject:item];
[item release];
}
, kindsOfItems , (Mac), (iPhone).