Hello,
I have a scene with a vector of layers.
Each layer contains some sprites, a string and a vector of color layers.
So, I've implemented 3 'dealloc' methods:
1. For the color layer - that calls only '[super dealloc]'.
2. For the layer - that releases the layer's members and pops the color layers (after they've released) from the vector.
3. For the scene - that pops and releases the layers from the vector, and also '[super dealloc]'.
All the above works fine.
The problem starts when I add '[super dealloc]' to the layer's dealloc method - looks like the layer's trying to be dealloced twice and the application crashes with 'exc_bad_instruction'.
Is this the right way to dealloc, should I keep using those 3 dealloc methods?
And if it is - how/where should I call the '[super dealloc]' in the layer's dealloc method without making it crash?
Thanks,
Keren