ios - Application force kill callback when user taps the red (-) button on the app icon -


when user force kills ios application need reset data in app. according apple's documentation post ios sdk 4.0 applicationwillterminate callback method not called , application killed without being notified. appreciate if helps me find solution/ other way capture event.

you should persist state by, in appdelegate, implementing

- (void)applicationwillresignactive:(uiapplication *)application

this called when the app enter background.

read more in apple documentation here

edit

you can't know if app terminated user or system while running in background. if need clean stuff, when app launched in:

- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -