I’m trying to save data to a Plist and I figured the best place would be in the Delegate .m “applicationWillTerminate” since Apple thoughtfully places a comment there “Save data if appropriate”.
However, it seems that this method never gets called when I’m testing with the iPhone Simulator. My NSLog statement never gets run.
So, is this the best place to save data when exiting the app and if so, do you know why it never seems to get called?
Since iOS 4 applications can enter in “background” instead of terminating, so
applicationWillTerminate:may not be called.You may want to use
applicationDidEnterBackground:also. You can create a method to save the data and call it in both delegate methods.