问题描述
我的测试,当我退出(通过按主页按钮)我的应用程序时,由于多任务处理功能,它仍然在后台运行".但是,我希望它在按下主页按钮时退出.这只发生在我身上吗?
I my testing, when I exit (by pressing the home button) my app, it still is "running" in the background, thanks to the multitasking feature. However, I would like it to quit when the home button is pressed. Is this only happening to me?
无论如何,我已将其追溯到应用委托中的 applicationWillResignActive 和 applicationDidBecomeActive 方法.这些被称为多任务处理,但是当我想终止时,应用程序退出活动".非常感谢有关此问题的任何指导!
Anyway, I have tracked it down to the applicationWillResignActive and the applicationDidBecomeActive methods in the app delegate. These get called for multitasking, but when I want to terminate, the app "resigns active." Any guidance on this issue is greatly appreciated!
推荐答案
您的应用程序可以选择退出多任务处理(请参阅 UIApplicationExitsOnSuspend 键到 Info.plist 并将其值设置为 YES.
Your application can opt out of multitasking (see the appropriate section in the iPhone Application Programming Guide) by adding the UIApplicationExitsOnSuspend key to your Info.plist and setting its value to YES.
实际上,Apple 强烈建议您不要这样做,除非您有充分的理由这样做.
In practice, Apple strongly recommends you not do this unless you have a very good reason for this behavior.
这篇关于按主页时退出应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)