I'm using this code to create some objects and then store them in an array
for (int iy=0; iy<5; iy++) {
for (int ix=0; ix<5; ix++) {
TerrainHex *myObject = [[TerrainHex alloc] initWithName:(@"grassHex instance 10000") width:mGameWidth height:mGameHeight indexX:ix indexY:iy];
myObject.myImage.y += 100;
[TerrainHexArray addObject:myObject];
[self addChild:(id)myObject.myImage];
}
}
NSLog(@"%lu", sizeof(TerrainHexArray));
Few questions.
- The log is only displaying 4, which makes no sense, shouldn't it be 5x5, i'e 25?
- Am I creating 25 seperate object pointers there or just re-using the same one over and over? I'm trying to save all 25 pointers into an array.
- I'm using ARC but do I have to release anything there?