Edit: The first (notification-based) approach probably won't work due to the inner workings of the startup loops and notifications.
If you want to adhere to the notification architecture, you can publish your own notifications in applicationWillTerminate: Just create your own MyApplicationWillTerminate notification, then call postNotification: on [NSNotificationCenter defaultCenter] . Then register your controller controller for MyApplicationWillTerminate instances, not the default UIApplicationWillTerminateNotification .
Another choice is for your application delegate to keep an instance of your edit controller, if one is visible, and then in applicationWillTerminate: save the new information before releasing the Core Data context. This contaminates the delegate of your application with additional instance variables, so this may not be the optimal solution.
One final thought: why not save the application, no matter what changes are made when the user makes them? This way, you donβt have to worry about the application being closed halfway through editing some of the information - the changes are already saved, and you can simply release the Core Data material as you already are. (Perhaps this is not suitable for you, I really could not say without knowing more about the structure of your application and the data you are editing.)
Tim
source share