Search code examples
iphonememory-managementdeallocuiapplicationdelegate

iPhone - Memory management question?


Let's say i have a navigation controller in my app delegate. Why is it necessary to release it on dealloc method in my appDelegate? When the dealloc method of my appDelegate is called, it means user is exiting the app, so the leak doesn't affect my application.

So why would i release anything in dealloc method of my appDelegate?


Solution

  • It's not necessary. Might even be cheaper to skip it and just let the OS free up the process.

    Unless any objects of yours do anything useful in their dealloc, like saving data.