0
votes

I have an app which consists multiple tabs managed by the class derived from UITabBarController (the only reason I subclassed UITabBarConteroller is to handle shake event for all views). 3 views are from subclassed UIViewContentroller class, one view is UINavigationController which shows a table. In every single controller I have, including my subclassed one, I have this:

  • (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning];

App works great. My question is how is default implementation of UITabBarController handles automatic view unloading on low memory conditions.

Only controller derrived from UINavigationController unload automatically (I see viewDidUnload called). viewDidUnload is NOT called for any other view controllers managed by UITabBarController.

Why?

Thanks

1

1 Answers

0
votes

viewDidUnload gets called when your view controller's view is removed and deallocated, and this happens after the VC receives didReceiveMemoryWarning. Check for that method being called first. If it's not being called, something else is going on, but if it is being called, then perhaps your view is over retained or not being removed properly.