In iDevice, we can use
- (void)applicationWillTerminate:(UIApplication *)application
But since iOS 4.0, application will goes to background instead of being killed when you press the home button.
If you are doing so,
- (void)applicationWillTerminate:(UIApplication *)application
From apple developer's guide,UIApplicationDelegate Protocol Reference
- (void)applicationDidEnterBackground:(UIApplication *)application
When you goes to background, and kill the app bu double click the home button and click the red cross,
- (void)applicationWillTerminate:(UIApplication *)application
will still being called. But if it died naturally, then it won't be called.
沒有留言:
張貼留言