如何以“故意例外”退出iPhone应用程序? [英] How to quit iPhone app with an "intentional exception"?

查看:70
本文介绍了如何以“故意例外”退出iPhone应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道Apple在关闭应用程序后会皱着眉头,因为用户可能会认为它崩溃了。

I know Apple frowns upon closing the app because the user might think it crashed.

因此,我如何故意使它退出并出现异常情况?当用户返回主屏幕时被捕获?另外,这会被App Store拒绝吗?

So how do I make it quit intentionally with an exception that doesn't get caught when the user goes back to the home screen? Also, would this be rejected by the App Store?

推荐答案

请查看以下问题的答案:

Please see the answer to this question:

强制后台应用程序执行以下操作:在iOS模拟器中终止

它将告诉您如何设置应用程序以使其在用户按下主页按钮时终止而不是后台运行。

It will tell you how to setup your application to terminate instead of backgrounding when the user hits the home button.

如果您不想这样做,建议您在代表的 applicationDidEnterBackground 触发时释放资源。我认为这是您最安全的选择。我们中不止一个人说您想要做的事并不理想。

If you don't want to do that, I recommend you should instead release resources when your delegate's applicationDidEnterBackground fires. I think that is your safest bet. More than one of us say what you're wanting to do is not ideal.

这篇关于如何以“故意例外”退出iPhone应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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