识别应用程序multitask-kill iPad [英] Recognize application multitask-kill iPad

查看:130
本文介绍了识别应用程序multitask-kill iPad的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何识别多任务杀戮。
当用户将应用程序置于后台状态,然后通过iOS 4.2中的菜单杀死应用程序时,我的应用程序将关闭。
之前曾经有过这样一个函数:

Does anybody know how to recognize a multitask-kill. When the user puts the application in background state and then kills the app through the menu in iOS 4.2 my application shuts down. Before there used to be an function called:

- (void)applicationWillTerminate:(UIApplication *)application

在iOS 4及更高版本中不再调用此方法。
有没有办法识别它?

This method is not called anymore in iOS 4 and higher. Is there a way to recognize it?

谢谢。

推荐答案

实际上并非完全正确。在不支持多任务处理的iOS4设备上调用 ,文档说可以在其他手机上调用(虽然我自己从未见过它)。

Actually that's not entirely true. It is called on iOS4 devices that do not support multi-tasking and the documentation says that it can be called on other handsets (though I've never seen it myself).

但要回答你的问题,不,你无法识别用户何时杀死你的应用。如果您有要保存的状态,则需要在应用程序进入后台时执行此操作,而不是在应用程序被杀死时执行此操作。

But to answer your question, no, you can't recognise when a user kills your app. If you have state that you want to save you need to do this when your app goes into the background and not when the app is killed.

如果您查看崩溃报告你会看到iOS发送的SIGKIL是你无法捕获的。

If you look at the crash reports you'll see that iOS sends SIGKIL which you can't catch.

这篇关于识别应用程序multitask-kill iPad的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆