I have a navigation-based app that switches between some ViewControllers.
If I press the "goHome" button, the method popViewControllerAnimated:
is called and I return to the main screen. There is a problem though : the dealloc method doesn't get called nor all the elements in that previous view get released. All the animations/UI elements remain hanging in the memory. What should I do?
First, it’s a good idea to switch to Automatic Reference Counting, would make your life easier. Second, make sure that there is no more retained reference to the controller or other objects.
Funny story, once I forgot to set an NSFetchedResultsController
’s delegate to nil and other memory errors and got an ugly exception when the fetched results controller tried to call the delegate, but it was already gone.