Type Method

unarchiveObjectWithFile:

Decodes and returns the object graph previously encoded by NSKeyedArchiver written to the file at a given path.

Declaration

+ (id)unarchiveObjectWithFile:(NSString *)path;

Parameters

path

A path to a file that contains an object graph previously encoded by NSKeyedArchiver.

Return Value

The object graph previously encoded by NSKeyedArchiver written to the file path. Returns nil if there is no file at path.

Discussion

This method raises an NSInvalidArgumentException if the file at path does not contain a valid archive.

See Also

Unarchiving Data

+ unarchivedObjectOfClass:fromData:error:

Decodes a previously-archived object graph, that returns the root object as the specified type.

+ unarchivedObjectOfClasses:fromData:error:

Decodes a previously-archived object graph, returning the root object as one of the specified classes.

requiresSecureCoding

Indicates whether the receiver requires all unarchived classes to conform to NSSecureCoding.

+ unarchiveObjectWithData:

Decodes and returns the object graph previously encoded by NSKeyedArchiver and stored in a given NSData object.

Deprecated
+ unarchiveTopLevelObjectWithData:error:

Decodes a previously-archived object graph, returning the root object.

Deprecated

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software