I have custom control like tabbar which displays many controllers some of them also have my tabbar with other controllers, so, my app uses lots of memory because every controller is stored in memory. So I want to unload invisible controller, but I not found any method for unloading UIViewController. How can I do it?
PS. I can not use UITabBarController, really can’t.
You don’t. UIViewControllers don’t get unloaded in low memory, just their views do.
This happens in
didReceiveMemoryWarningon your own view controllers and gets called automatically when a low memory warning occurs.Override this and unload anything that can be re-created in
viewDidLoad.