Newbie question.
I have a NSMutableArray that holds multiple objects (objects that stores bezier paths and related variables e.g. path colour ect.) These are properly released whenever the relevant -dealloc
method is called. Each object is instansiated with +alloc/-init
and added to the array. After adding them to the array I release
the object and hence their retainCount=1 (due to the array). Thus, when the array is released, the objects are also properly dealloc
ated.
But, I'm also implementing an undo/redo mechanism that removes/adds these objects from/to the NSMutable array.
My question is, when an undo removes the object from the array, they are not released (oterwise redo will not work) so if redo is never called, how do you properly release these object?
Hope that makes sense! Thanks!