iPhone:我的应用程序需要支持多任务处理吗?
现在这是上传到应用商店之前的强制要求吗?据我了解,使我的应用程序与多任务兼容是我需要实现的额外任务。 (?)
Is this now a mandatory requirement before uploading to the app-store? As I understand it, making my app compatible with multitasking is something extra that I need to implement. (?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,
这不是额外的东西。这是一个选择退出的过程。阅读 此 Apple 文档。
我个人的观点是,如果您不积极支持多任务处理,则应该选择退出。
No.
It's not something extra. It's an opt-out process. Read this Apple doc.
My personal opinions is that if you don't actively support multi-tasking, you should opt-out from it.
您的应用程序不需要利用多任务处理功能,但它确实需要优雅地处理放入后台的情况,并且永远不会收到应用程序将退出的通知。更具体地说:
在以前版本的操作系统中,当用户退出应用程序(通过按主页按钮)时,
将调用应用程序委托。在 iOS 4 下,按下设备的主页按钮会将应用程序置于后台,调用应用程序代理。
当应用程序再次进入前台时,操作系统调用应用程序代理。
当状态更改时,这最常给旧应用程序带来麻烦 - 用户首选项、数据文件、高分等——在调用 applicationWillTerminate 时被写出并保存。现在它不再被调用,一些应用程序无法保存用户信息。
调用 applicationWillTerminate 时您所做的大多数事情现在也应该放置在 applicationDidEnterBackground 中,具体取决于您的应用程序的功能。
此外,您在 application didFinishLaunchingWithOptions 中执行的某些操作可能也需要在 applicationWillEnterForeground 中完成,具体取决于您的应用的用途。
Your app does not need to take advantage of the multitasking features, but it DOES need to gracefully handle being put in the background and never receiving a notice that the application will quit. More specifically:
Under previous versions of the OS when the user quit the app (by pressing the home button) the App Delegate's
was called. Under iOS 4 pressing the device's home button instead puts the app in the background, calling the App Delegate's
When the app is brought to the foreground again the OS call's the App Delegate's
This most commonly caused trouble for older apps when state changes -- user preferences, data files, high scores, etc. -- were being written out and saved when applicationWillTerminate was called. Now that it's no longer being called, some apps fail to save user information.
Most anything that you were doing when applicationWillTerminate was called should now also be placed in applicationDidEnterBackground, depending on what your app does.
Additionally, it's possible that some things you were doing in application didFinishLaunchingWithOptions will also need to be done in applicationWillEnterForeground, depending on what your app does.
支持多任务处理并不是强制性的。
要禁用多任务处理,您可以使用 info.plist 文件中的 UIApplicationExitsOnSuspend 键,该键可能显示为“应用程序不在后台运行”。
请参阅 http://developer.apple.com/ Library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html 了解更多信息。
It is not mandatory to support multitasking.
To disable multitasking, you can use the UIApplicationExitsOnSuspend key in your info.plist file, which may appear as "Application does not run in background."
See http://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html for more information.