applicationWillTerminate not get called [IOS]

来源:互联网 发布:pandas 数据分析 实例 编辑:程序博客网 时间:2024/05/21 20:26

In short, unless you have UIApplicationExitsOnSuspend inyour Info.plist set to YES, in iOS4 and above there is no guaranteethat applicationWillTerminate: willever get called.

As thedocumentation says:

For applications that support background execution, this method isgenerally not called when the user quits the application becausethe application simply moves to the background in that case.However, this method may becalled in situations where the application is running in thebackground (not suspended) and the system needs to terminate it forsome reason

(Emphasis mine.)

If you need to do something before the app exits you need to do itinapplicationDidEnterBackground:.There is no way to catch SIGKILL.

0 0
原创粉丝点击