Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
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.”