A coder that stores an object's data to an archive.
- macOS 10.0–10.13Deprecated
NSArchiver, a concrete subclass of
NSCoder, provides a way to encode objects into an architecture-independent format that can be stored in a file. When you archive a graph of objects, the class information and instance variables for each object are written to the archive. The companion class
NSUnarchiver decodes the data in an archive and creates a graph of objects equivalent to the original set.
NSArchiver stores the archive data in a mutable data object (
NSMutable). After encoding the objects, you can have the
NSArchiver object write this mutable data object immediately to a file, or you can retrieve the mutable data object for some other use.