12.10. Opting Out of Multitasking
Problem
You do not want your application to participate in multitasking.
Solution
Add the UIApplicationExitsOnSuspend
key to your
application’s main .plist file
and set the value to true
:
<dict> ... ... ... <key>UIApplicationExitsOnSuspend</key> <true/> ... ... ... </dict>
Discussion
In some circumstances, you might require that your iOS
applications not be multitasking (although I strongly encourage you to
develop your applications to be multitasking-aware). In such cases, you
can add the UIApplicationExitsOnSuspend
key to your
application’s main .plist file.
Devices on the latest iOS versions that support multitasking
understand this value and the OS will terminate an application with
this key set to true
in the
application’s .plist file. On
earlier iOS versions without support for multitasking, this value will
have no meaning to the operating system and will be ignored.
When such an application runs on the latest iOS, the following application delegate messages will be posted to your application:
application:didFinishLaunchingWithOptions:
applicationDidBecomeActive:
If the user presses the Home button on the device, the following messages will be sent to your application delegate:
applicationDidEnterBackground:
applicationWillTerminate:
Get iOS 5 Programming Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.