Hi Jugibur. I see what you're saying with the self and super init. I see that I am very inconsistent with it. I will go and update my code to do it the preferred way.
In terms of the dealloc and arc discussion. I know that it may be taken care of for me, but what is the best practice for this? I want to make sure I understand how to do this the right way not just the way that works.
I understand alloc, release, retain, and the object reference counting. I think an area that is fuzzy for me is with objects that I really want to keep in memory until the app closes. Also, with collections where the disconnect is.
For example, when I add the images to make my map:
SPImage* img = [[[SPImage alloc] initWithTexture:[mTileSet tileByGid:i.tileGid]]autorelease];
img.x = i.y*mTileSet.tileWidth;
img.y = i.x*mTileSet.tileWidth;
When I do the addChild, is that copying a pointer to that img object I made or actually creating a copy of the object in the DisplayObjects array? If I look into the addChild method the code seems to be putting the retain count up, breaking the link to the parent, then adding it to the children array, and setting the parent to the map's display object container.
[mChildren insertObject:child atIndex:MIN(mChildren.count, index)];
child.parent = self;
To me if I called dealloc on img after I called addChild it wouldn't make sense because it would be retained in the addChild method, right?