I am trying to manage a few animations in my scene using the following method:
In a loop, create animated UIImageView, set the on stopped method. Also, store this UIImageView in a NSMutableDictionary. The animation ID is the same as the key in the dictionary.
When this animation is stopped, get the animation ID. Use [animations objectForKey: animationID] to get the imageview object. I remove the imageview from the superview and release it. I also remove the object from the dictionary using the key.
Create another animated object, rinse, repeat.
The problem is, when I go to get the object based on the key, NULL is returned. I assume this is related to how the dictionary works-- it copies the values instead of retaining them. Because it is copied, I can't actually remove that object.
How can I get NSDictionary to NOT copy these objects (so I have the original) or how do I release these animated objects and remove them from the superview when they are done animating?