I'm trying to handling memory management properly using the didReceiveMemoryWarning signal in all controllers. I'm using loadView to allocate the visible resource (typically just a table view). When the didReceiveMemoryWarning function is called I do the following:
- (void)didReceiveMemoryWarning {
[self freeResources]; // Frees all resources allocated in loadView().
[super didReceiveMemoryWarning];
}
The problem I'm having is this is called even on the currently visible UITableViewController. This essentially frees the table view, but does not call loadView (probably cause the view is already visible). At this point tapping on a table cell does not do anything, and causes other issues.
The documentation implies that the didReceiveMemoryWarning is not called if the view controller is currently visible, but this is not the case.
This really causes havoc for me. Any ideas what the issue is?
- (void)didReceiveMemoryWarning {
[self freeResources]; // Frees all resources allocated in loadView().
[super didReceiveMemoryWarning];
}
The problem I'm having is this is called even on the currently visible UITableViewController. This essentially frees the table view, but does not call loadView (probably cause the view is already visible). At this point tapping on a table cell does not do anything, and causes other issues.
The documentation implies that the didReceiveMemoryWarning is not called if the view controller is currently visible, but this is not the case.
This really causes havoc for me. Any ideas what the issue is?