使用exit(0)关闭iphone 4中的应用程序,而不是以后台模式发送它 [英] use exit(0) to close an app in iphone 4 instead of send it in background mode

查看:78
本文介绍了使用exit(0)关闭iphone 4中的应用程序,而不是以后台模式发送它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到使用SDK 4按下iphone按钮会在后台发送应用程序。
由于我正在处理登录和其他问题,我发现最好关闭应用程序而不是以后台状态发送它。所以我会在(void)applicationDidEnterBackground:(UIApplication *)应用程序中放入一个 exit(0); 语句。

I've noticed that pressing the iphone button using SDK 4 sends the application in background. Since I'm dealing with login and other problems I find better closing the app instead of sending it in background status. So I would put an exit(0); statement inside (void)applicationDidEnterBackground:(UIApplication *)application.

这是正确的方法还是违反Apple的指导方针?

Is it a correct approach or is against Apple guidelines?

推荐答案

实际上我自己找到了答案:我可以在info.plst中设置选项应用程序不在后台运行来控制此行为而不是使用exit(0)命令

actually i found the answer by myself: I can set in the info.plst the option "Application does not run in background" to control this behavior instead of using exit(0) command

这篇关于使用exit(0)关闭iphone 4中的应用程序,而不是以后台模式发送它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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