How to perform last actions upon user exiting an iPhone app?
问题 Is there a way to perform some last actions when the user kills the application on iPhone? In UIApplicationDelegate there is applicationWillTerminate: but as I understand it's not guaranteed to get called when the application terminates. Is there another way? 回答1: You can't rely on applicationWillTerminate being called. From the documentation: For apps that do not support background execution or are linked against iOS 3.x or earlier, this method is always called when the user quits the app.