Instance Property

requiresSecureCoding

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

Declaration

@property(readwrite) BOOL requiresSecureCoding;

Parameters

flag

YES if the receiver requires NSSecureCoding; NO if not.

Discussion

If you set the receiver to require secure coding, it will throw an exception if you attempt to unarchive a class which does not conform to NSSecureCoding.

The secure coding requirement for NSKeyedUnarchiver is designed to be set once at the top level and remain on. Once enabled, attempting to call setRequiresSecureCoding: with a value of NO will throw an exception. This is to prevent classes from selectively turning secure coding off.

Note that the getter is on the superclass, NSCoder. See NSCoder for more information about secure coding.

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.

+ 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
+ unarchiveObjectWithFile:

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

Deprecated