开发者

IPhone: Does my app need to support multitasking?

Is this now a mandatory requirement before uploading to the app-store? As I understand it, makin开发者_运维知识库g my app compatible with multitasking is something extra that I need to implement. (?)


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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜