IPhone: Does my app need to support multitasking?

和自甴很熟 提交于 2019-12-13 03:31:52

问题


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. (?)


回答1:


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.




回答2:


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.




回答3:


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

applicationWillTerminate

was called. Under iOS 4 pressing the device's home button instead puts the app in the background, calling the App Delegate's

applicationDidEnterBackground

When the app is brought to the foreground again the OS call's the App Delegate's

applicationWillEnterForeground

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.



来源:https://stackoverflow.com/questions/3860939/iphone-does-my-app-need-to-support-multitasking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!