views:

35

answers:

1

I have an app that holds a lot of pictures and when the user browses them the live bytes in my app gets to max 88 mb.

firstly what does that me, The app doesnt crash, it gets a little slower. but is that 88mb in memory ?

Secondly I have a UIView which I set its view to an image depending on the number in the counter. Is there a way to release that previous image or at least only to keep 5 images in memory and release the rest ? e.g. keep -2 -1 0 1 2 , when 3 is called, release -2.

thanks

+2  A: 

Secondly I have a UIView which I set its view to an image depending on the number in the counter. Is there a way to release that previous image or at least only to keep 5 images in memory and release the rest ? e.g. keep -2 -1 0 1 2 , when 3 is called, release -2.

Take a look at the push and pop method additions to NSMutableArray which are posted in a separate Stack Overflow question on containers. This would let you add and remove from the head and tail of a mutable array of UIView references.

Alex Reynolds
Thanks. what you said made me think and I just solved it by putting a statement to release the UIImage (index -2) when the "next image" is pressed and vice versa. :)
alJaree