David Casillas
David Casillas

Reputation: 1911

What happens when the system purges an app while in background?

I know my app can be killed while in background by the system.

Is it also possible to have its data structures released but the app not being killed?

Should I also restore local data in -(void)applicationWillEnterForeground:?

If the app is killed it will come back through -(BOOL)application:didFinishLaunchingWithOptions: so my data will be restored, but if it is not killed but its data structures released it will came back through - (void)applicationWillEnterForeground: so no data will be restored.

Upvotes: 0

Views: 49

Answers (1)

Marcus S. Zarra
Marcus S. Zarra

Reputation: 46718

If your app is killed and then relaunched your -application: didFinishLaunchingWithOptions: will be called.

If your app is backgrounded and then resumed -applicationWillEnterForeground: will be called.

You should not need to restore data state when -applicationWillEnterForeground: is called.

Upvotes: 1

Related Questions