From what I understand, the viewDidUnload
method is called by didRecieveMemoryWarning
function in the UIViewController
(the super class). Basically iOS gives you couple of warnings and expect to see your memory usage go down. If you continue to ignore these, OS will kill your app.
Sometimes, though, it is critical to keep some views up and running so the way I get around this is to simply override the didRecieveMemoryWarning
method and inside it, don't do anything.
Or better yet, check if self
is the current view in the self.navigationController.visibleViewController
, and if so, don't pass the memory warning call down to [super didRecieveMemoryWarning]
.
If you are holding image caches or something, just empty those instead.
HTH