Instance Method

initForReadingFromData:error:

Initializes an archiver to decode data from the specified location.

Declaration

- (instancetype)initForReadingFromData:(NSData *)data error:(NSError * _Nullable *)error;

Parameters

data

An archive previously encoded by NSKeyedArchiver.

Discussion

This initializer enables requiresSecureCoding by default, and sets the decodingFailurePolicy to NSDecodingFailurePolicySetErrorAndReturn.

Call finishDecoding when you finish decoding data

This method throws an error if data isn’t a valid keyed archive.

See Also

Creating a Keyed Unarchiver

- init

Initializes an archiver to decode data.

Deprecated
- initForReadingWithData:

Initializes an archiver to decode data from the specified location.

Deprecated