CHAPTER 28

image

Object Archiving

Object Archiving Defined

Saving a copy of your app’s object graph to be used later on as a backup is called object archiving. Objective-C has classes that can help you archive your object graph. Each class that supports archiving must adopt the NSCoding protocol and implement two methods needed by the NSKeyedArchiver and NSKeyedUnarchiver classes.

NSCoding

Each class that will support archiving must adopt the NSCoding protocol and implement the required methods. These methods will help the archivers to store the property values stored in the objects that need to be archived.

To adopt the NSCoding protocol, add the ...

Get Objective-C Quick Syntax Reference 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.