I\'d like to know whether or not both viewDidUnload
and dealloc
are always called in succession in the UIViewController tear-down process.
It is quite thoughtful that, viewDidiUnload method get only called when memory warning appears. Good practise would be to release requisite the object within this method and also make the object nil.
viewDidUnload
will not be called every time like dealloc
method. viewDidUnload
is called only when your app receives low memory warning!
Just think, if you are releasing your object both in viewDidUnload
and dealloc
methods. If both gets called every time, then you are releasing already released object, which will lead to application crash, isn't it?. viewDidUnload
is a place provided by the Apple for cleaning up the things when receiving the low memory warning because you know in iPhone we have memory restriction.