Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

12. Multitasking > 12.6. Saving and Loading the State of Multitasking iOS Apps

12.6. Saving and Loading the State of Multitasking iOS Apps

Problem

You want the state of your iOS app to be saved when it is sent to the background, and for the same state to resume when the application is brought to the foreground.

Solution

Use a combination of the UIApplicationDelegate protocol’s messages sent to your application delegate and the notifications sent by iOS to preserve the state of your multitasking apps.

Discussion

When an empty iOS application (an application with just one window and no code written for it) is run on an iOS device with support for multitasking for the first time (not from the background), the following UIApplicationDelegate messages will be sent to your app delegate, in this order:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial