iOS how to detect when app was removed from process

You can’t detect this. From the iOS App Programming Guide (“App Termination” heading):

Important: The applicationWillTerminate: method is not called if your app is currently suspended.

Even if you develop your app using iOS SDK 4 and later, you must still
be prepared for your app to be killed without any notification. The
user can kill apps explicitly using the multitasking UI. In addition,
if memory becomes constrained, the system might remove apps from
memory to make more room. Suspended apps are not notified of
termination but if your app is currently running in the background
state (and not suspended), the system calls the
applicationWillTerminate: method of your app delegate. Your app cannot
request additional background execution time from this method.

Leave a Comment