When my app is run in the iPhone simulator, the delegate method
- (void)applicationWillTerminate:(UIApplication *)application
is only called the first time I hit the iPhone simulator’s home button.
After the home button is pressed and the app is launched again, hitting the home button does not call the delegate method.
What is going on here? Am I misunderstanding something fundamental?
I suspect that it is being called, but that you are getting confused because after you hit the Home button in the Simulator, you’ve ended the current session in Xcode. You probably have an
NSLogin yourapplicationWillTerminate:method, yes? Once you hit the Home button,NSLogs no longer show up in Xcode’s run console. If you open/Applications/Console.appI expect they’ll show up there.