for a UIViewController which methods should a “release” and set to “nil” the outlets/instance variables?
That which of the methods out of “viewDidUnload” and “dealloc” should I be putting:
- The “release” for outlets or other member variables in the class, and
- The “xxx = nil” (i.e. set to nil) in
In viewDidUnload typical practice is to nil, using accessors, any objects embedded in the view controller’s view – buttons, views, textfields, any descendant of UIView that could be in the view hierarchy:
In dealloc you should release ALL retained variables directly, including subviews: