Archives and serializations are two ways in which you can create architecture-independent byte streams of hierarchical data. Byte streams can then be written to a file or transmitted to another process, perhaps over a network. When the byte stream is decoded, the hierarchy is regenerated. Archives provide a detailed record of a collection of interrelated objects and values. Serializations record only the simple hierarchy of property-list values.
You should read this document to learn how to create and extract archived representations of object graphs.
Organization of This Document
This programming topic contains the following articles:
“Object Graphs” introduces the concept of an object graph and discusses the two techniques for turning objects into byte streams: archives and serializations.
“Archives” describes the different types of archive and archiver classes.
“Creating and Extracting Archives” describes how to create and extract an archive.
“Encoding and Decoding Objects” describes how to implement the methods that allow an object to be encoded in and decoded from archives.
“Encoding and Decoding C Data Types” describes how to encode and decode C data types that do not have convenience methods defined in the archive classes.
“Forward and Backward Compatibility for Keyed Archives” provides some tips on how to make your classes more compatible with previous and future versions of your classes in keyed archives.
“Subclassing NSCoder” provides some tips on how to create your own coder classes.
“Serializing Property Lists” describes how to create and read serialized representations of a property list.
© 2002, 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-07-17)