Wow, I had no idea. Thanks, that really helped. So I should write:
Code:
NSMutableArray *myArray = [[NSMutableArray alloc] init];
enemiesArray = myArray;
[myArray release];
Is that correct? I'm not sure why you said my first way was okay for an init method. According to your tutorial, won't that mess up the retain count and put it to 2 instead of 1 (doesn't it retain the new value, which is already to 1 because it's been alloc'd)?
EDIT: OK no, wait. Instance variable != instance property. So it IS okay to write enemiesArray = [[NSMutableArray alloc] init], but it's NOT okay to write [self setEnemiesArray:[[NSMutableArray alloc] init]], RIGHT? lol
And for the enemies part:
Code:
enemy *myEnemy = [[enemy alloc] initAtX:-1 y:-1];
[enemiesArray addObject:myEnemy];
[myEnemy release];