Q: What method gets called when iPhone app exits? I know that -applicationWillResignActive gets called upon an incoming call, but is there a standard method that gets called if the user hits the "exit" button (the only button on the front of the iPhone)?  

A: - (void)applicationWillTerminate:(UIApplication *)application, in UIApplicationDelegate protocol.

A: I made some try and i'm using iPhone SDK 4, and when you press the "exit" button the app called two methods:
(void)applicationWillResignActive:(UIApplication *)application
(void)applicationDidEnterBackground:(UIApplication *)application

