Hi Friends,
When we need to release an object,where to do it, either at the dealloc method or in the ViewDidUnload for a viewController? which would be better?
I think that viewDidUnload would do better, because once the view controller is unloaded the objects would be released. And in the dealloc case, from the documentation
When an application terminates, objects may not be sent a dealloc message. Because the process’s memory is automatically cleared on exit, it is more efficient simply to allow the operating system to clean up resources than to invoke all the memory management methods.
the objects may not be sent a dealloc message upon the Application quitting.
So I find it would be better if objects got released earlier, than postponing their release thereby reducing the memory footprint the Application takes.
If my understanding is wrong, please correct me.
Thanks and Regards, Krishnan