iOS app lifecycle 4/3GS/iPad vs 2G/3G

后端 未结 1 350
隐瞒了意图╮
隐瞒了意图╮ 2021-01-25 05:50

I\'ve read the Apple\'s documentation about application lifecycle and made some tests to figure out what is the applications life cycle on different devices. (All running iOS 4

相关标签:
1条回答
  • 2021-01-25 05:59

    I think you're right. When you kill an app from the taskbar (or when your device is running low on memory and the OS kills the app for you), it just sends a SIGKIL signal. As you note, it never calls any of the callbacks.

    According to the documentation:

    For applications that support background execution, this method is generally not called when the user quits the application because the application simply moves to the background in that case. However, this method may be called in situations where the application is running in the background (not suspended) and the system needs to terminate it for some reason.

    So, iOS can call the applicationWillTerminate: method but probably won't. (I've never seen it.)

    If you want to save any state before your app is killed, you need to do it as it goes into the background.

    0 讨论(0)
提交回复
热议问题