iPhone 在后台关闭应用程序:exit(0) 可以接受还是存在其他问题?
在某些情况下,我需要阻止应用程序留在后台: 如何阻止 MPMoviePlayerViewController 下载如果应用程序在后台,则视频
我不想禁用多任务处理,但在某些情况下我需要关闭应用程序
exit(0)
效果很好,但是这是吗苹果认可吗? exit(0)
不会造成任何用户体验问题,因为它发生在后台,用户看不到任何内容。
有谁知道还有其他选择吗?
提前致谢!
I need to stop in some situation an application from remaining in background:
how to stop MPMoviePlayerViewController from downloading video if the app is in background
I don't want to disable the multitasking, but in some situation I need to close the app
exit(0)
works perfectly, but is this approvable by Apple?exit(0)
doesn't create any user-experience problems, because it happens in background and the user doesn't see anything.
Does anyone know any other alternatives?
Thanks in Advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,这是不允许的,您应该让用户完全控制何时退出您的应用程序。
http://developer.apple.com/库/ios/#DOCUMENTATION/UserExperience/Conceptual/MobileHIG/UEBestPractices/UEBestPractices.html
No, that's not allowed and you should give the user full control when to exit your app.
http://developer.apple.com/library/ios/#DOCUMENTATION/UserExperience/Conceptual/MobileHIG/UEBestPractices/UEBestPractices.html
看起来我完全可以接受。 exit(0) 和内存警告的kill -KILL 之间没有太大区别。前提是您在启动后将 UI 恢复到相当一致的状态。
当然,AppStore警察可能有不同的意见......
Looks perfectly acceptable to me. Not much difference between exit (0) and the kill -KILL of a memory warning. Provided you restore the UI to a reasonably consistent state after startup.
Of course, AppStore police might have different opinions...