How does UIImage work in low-memory situations?

Posted by kubi on Stack Overflow See other posts from Stack Overflow or by kubi
Published on 2010-03-23T00:25:59Z Indexed on 2010/03/23 0:31 UTC
Read the original article Hit count: 504

Filed under:
|
|

According to the UIImage documentation:

In low-memory situations, image data may be purged from a UIImage object to free up memory on the system.

Does anyone know how this works? It appears that this process is completely transparent and will occur in the background with no input from me, but I can't find any definitive documentation one way or the other.

Second, will this data-purge occur when the image is not loaded by me? (I'm getting the image from UIImagePicker).

Here's the situation: I'm taking a picture with the UIImagePickerController and and immediately taking that image and sending it to a new UIViewController for display. Sending the raw image to the new controller crashes my app with memory warnings about 30% of the time. Resizing the image takes a few moments, time that I'd rather not spend if there's a 3rd option available to me.

© Stack Overflow or respective owner

Related posts about uiimage

Related posts about iphone