memory-managementmemory-leaksuiviewcontrollerios6ipad-3

How to release everything thats retained by a viewController?


I have 5 viewControllers which are reloaded each time I tap onto them. I want to reduce the memory allocations so in viewDidDisappear i am making all the IBOutlets nil , but still I want to reduce more memory,which is all that is retained by the controller. Will I have to do it individually or is there any method which will do the magic for me?


Solution

  • Setting IBOutlets to nil in viewDidDisappear releases nothing as these will all still be retained by the view.

    You could release your other objects though, and then recreate in viewDidAppear but it's hard to understand why you would want to, just do it when asked in the didReceiveMemoryWarning method.