问题描述
在iOS4.0之前点击iPhone上的主页按钮退出应用程序,Apple在他们的指南中没有接受以编程方式退出应用程序。
Before iOS4.0 clicking the home button on iPhone exits the application, and Apple had in their guide that programmatically exiting the application was not accepted.
现在一切都改变了在iOS4.0中,单击主页按钮可使您的应用程序处于挂起模式(多任务处理)..我认为应该有一个明确的方式让用户退出应用程序,如退出按钮。
now everything changed in iOS4.0, clicking the home button puts your app in a suspended mode (multitasking).. and I think there should be a clear way for the user to exit the app, like an exit button.
苹果现在好吗?怎么办呢?
is it now OK with apple? and how can it be done?
推荐答案
不,不应该这样做。
你有不同阶段的处理程序,所以这就是你应该这样做的。手动退出没有意义。如果你重新启动应用程序,理想情况下它会从你离开的地方开始,所以这可以通过恢复或启动并加载旧状态来实现。
You have handlers for the different stages, so this is how you should do it. There's no point in exiting manually. If you restart the app, ideally it would start where you left off, so this is either by resuming or by starting and loading the old state.
无理由退出。
修改
随着这种情况不断出现:说不要以编程方式退出。我们已经看到很多关于过去曾调用exit()的应用程序的报告。
As this keeps popping up again: iOS Human Interface Guidelines says "Don't Quit Programmatically". And we have seen many reports of apps that had calls to exit() in them in the past.
通过在Info.plist中设置相应的密钥退出而不是暂停文件当然完全没问题 - 但这不是一个专用的UI按钮,只是通过主页按钮的程序退出的特定于应用程序的实现。
Exiting instead of suspending by setting the appropriate key in the Info.plist file is perfectly fine, of course - but that's not a dedicated UI Button, just application-specific implementation of program exit by the home button.
这篇关于退出iOS 4.0中的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!