Only applicationWillResignActive called when iPhone shuts down?

后端 未结 3 1336
南笙
南笙 2021-02-15 15:26

Hallo experts,

I\'ve tested what\'s happing with my app when the iPhone is switched off while the app is active. For this purpose I logged the callback

3条回答
  •  天命终不由人
    2021-02-15 16:14

    I've made some further tests:

    I've saved the called lifecycle methods in a database and turned off the iPhone while may application was running. Actually only applicationWillResignActive is called. But after the shut down my application resides in the state "not running", because launching it initiates calls of application:didFinsihLaunchingWithOptions: and applicationDidBecomeActive. So the application data is lost if I don't save it in applicationWillResignActive.

    If the battery is empty while an application is running applicationDidEnterBackground and applicationWillTerminate are called (no call of applicationWillResignActive!).

提交回复
热议问题