Type Method

archiveRootObject:toFile:

Archives an object graph rooted at a given object to a file at a given path.

Declaration

+ (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path;

Parameters

rootObject

The root of the object graph to archive.

path

The path of the file in which to write the archive.

Return Value

YES if the operation was successful, otherwise NO.

Discussion

This method archives the graph formed by the root object to a data object, then atomically writes it to the given path. The format of the archive is NSPropertyListBinaryFormat_v1_0.

See Also

Archiving Data

+ archivedDataWithRootObject:requiringSecureCoding:error:

Encodes an object graph with the given root object into a data representation, optionally requiring secure coding.

- finishEncoding

Instructs the receiver to construct the final data stream.

encodedData

The encoded data for the archiver.

outputFormat

The format in which the receiver encodes its data.

requiresSecureCoding

Indicates whether the archiver requires all archived classes to resist object substitution attacks.

+ archivedDataWithRootObject:

Returns a data object that contains the encoded form of the object graph formed by the given root object.

Deprecated