Good question, I was also confused.
now i got this:
It is said that there is no object managed by our custom code that the appDelegate class itself needs, we really do not need to worry to “free” its instance. UIApplication is the only class that saves it, but we should not.
But, for academic discussion or if there is some purpose that I don’t know at the moment when you want to test dealloc in the class appDelegate:
applicationWillTerminate is the right place to find out if your application will close.
- (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. [UIApplication sharedApplication].delegate = nil; // after this, the dealloc method of our appDelegate class will be called }
source share