Class

NSUnarchiver

A decoder that restores data from an archive.

Declaration

@interface NSUnarchiver : NSCoder

Overview

NSUnarchiver, a concrete subclass of NSCoder, defines methods for decoding a set of Objective-C objects from an archive. Such archives are produced by objects of the NSArchiver class.

In macOS 10.2 and later, NSArchiver and NSUnarchiver have been replaced by NSKeyedArchiver and NSKeyedUnarchiver respectively—see Archives and Serializations Programming Guide.

Topics

Initializing an NSUnarchiver

- initForReadingWithData:

Returns an NSUnarchiver object initialized to read an archive from a given data object.

Decoding objects

+ unarchiveObjectWithData:

Decodes and returns the object archived in a given NSData object.

+ unarchiveObjectWithFile:

Decodes and returns the object archived in the file path.

Managing an NSUnarchiver

atEnd

A Boolean value that indicates whether the receiver has reached the end of the encoded data while decoding.

- objectZone

Returns the memory zone used to allocate decoded objects.

- setObjectZone:

Sets the memory zone used to allocate decoded objects.

systemVersion

The system version number in effect when the archive was created.

Substituting classes or objects

+ classNameDecodedForArchiveClassName:

Returns the name of the class used when instantiating objects whose ostensible class, according to the archived data, is a given name.

+ decodeClassName:asClassName:

Instructs instances of NSUnarchiver to use the class with a given name when instantiating objects whose ostensible class, according to the archived data, is another given name.

- classNameDecodedForArchiveClassName:

Returns the name of the class that will be used when instantiating objects whose ostensible class, according to the archived data, is a given name.

- decodeClassName:asClassName:

Instructs the receiver to use the class with a given name when instantiating objects whose ostensible class, according to the archived data, is another given name.

- replaceObject:withObject:

Causes the receiver to substitute one given object for another whenever the latter is extracted from the archive.

Relationships

Inherits From

See Also

Deprecated

NSArchiver

A coder that stores an object's data to an archive.

Deprecated
NXReadNSObjectFromCoder

Returns the next object from the coder.

Deprecated