views:

27

answers:

1

I have an AnimationManager class which cycles through UIImages to create a 14 frame animation. The application runs out of memory when the animations are played over and over. It was my understanding that I should not release UIImage. I do however, release the array containing the images.

What can I do to reduce the memory used by the animations?

There are four separate animations, the largest animation has a collection of images equal to 6 MB. The smallest collection of images is 1.5 mb.

A: 

It was my understanding that I should not release UIImage. I do however, release the array containing the images.

Arrays in themselves are small (4 bytes per object on iPhone), so releasing them is silly. Who says you don't need to release UIImages?

It sounds like you don't understand memory management conventions in Objective-C, but without seeing code it's difficult to help.

Have you tried running your code in Leaks?

tc.
It was my understanding that you do not release anything you did not call alloc, copy, or new on. Regardless, the solution in this post solved my problem. http://stackoverflow.com/questions/924740/dispelling-the-uiimage-imagenamed-fud Thank you for the response.
Oh Danny Boy
You should release it if you've retained it.
tc.