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

Motivation

Use the Archiving and Unarchiving pattern any time you need to copy or store a group of interrelated objects. Some Cocoa applications adopt this approach to store application data in files. Because most Cocoa objects automatically work with the Archiving and Unarchiving pattern, it’s straightforward to save application data by just archiving your application’s objects. To reload the application data, unarchive the objects. The previous application state is restored.

The Archiving and Unarchiving pattern is sometimes used to implement the “deep” Copying pattern as explained in Chapter 12 “Copying.”


  

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