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?
Asked
Active
Viewed 56 times
1
-
umm... so when the view appears again (viewDidAppear), what happens? – newacct Nov 06 '12 at 01:50
1 Answers
0
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.
Declare your IBOutlets as weak and let the system decide when to release the view (and the outlets along with it) when it needs to.
Release any other objects you want to drop in low memory conditions inside the
didReceiveMemoryWarning
method. Once again the system decides when this is needed.

trapper
- 11,716
- 7
- 38
- 82