UIViewController prevent view from unloading

Posted by Ican Zilb on Stack Overflow See other posts from Stack Overflow or by Ican Zilb
Published on 2010-06-03T11:40:26Z Indexed on 2010/06/03 11:44 UTC
Read the original article Hit count: 322

When my iPhone app receives a Memory warning the views of UIViewControllers that are not currently visible get unloaded. In one particular controller unloading the view and the outlets is rather fatal.

I'm looking for a way to prevent this view from being unloaded. I find this behavior rather stupid - I have a cache mechanism, so when a memory warning comes - I unload myself tons of data and I free enough memory, but I definitely need this view untouched.

I see UIViewController has a method 'unloadViewIfReloadable', which gets called when the Memory Warning comes. Does anybody know how to tell Cocoa Touch that my view is not reloadable?

Any other suggestions how to prevent my view from being unloaded on Memory Warning?

Thanks in advance

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone-sdk