开发者

applicationWillTerminate not called when application stopped from Xcode

I have got into an strange issue, where the - (void)applicationWillTerminate:(UIApplication *)application{} and - (void)applicationDidEnterBackground:(UIApplication *)application{}开发者_JAVA技巧 are not called when I try to stop the application from Xcode as opposed to home button.


This behavior is expected, because Xcode is not the home button on your iOS device.

If you click "Build and Run", for example, while testing another app, you will be prompted to kill the first app. If you do, then the first app will close as if it never opened. This seems to be a consequence of the application sandboxing.

On a similar note, If you hit the home button while testing an app on a multitasking capable device, then the app will continue to run in background mode and it will not trigger applicationWillTerminate. Your device should however, trigger applicationDidEnterBackground.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜