Instance Property

decodingFailurePolicy

The action to take when this unarchiver fails to decode an entry.

Declaration

@property(readwrite) NSDecodingFailurePolicy decodingFailurePolicy;

Discussion

The unarchiver may fail to decode an entry for the following reasons:

  • The keyed archive data is corrupt or missing.

  • A type mismatch occurs, such as expecting a class by calling decodeObject(of:forKey:), but the unarchiver encounters a numeric value for that key instead. This also occurs when decodeIntForKey: encounters a value encoded as floating-point, or vice versa.

  • A secure coding violation occurs. This happens when attempting to decode an object that doesn’t conform to NSSecureCoding. This also happens when the encoded type doesn’t match any of the classes passed to unarchivedObjectOfClasses:fromData:error:.

See Also

Decoding Data

- containsValueForKey:

Returns a Boolean value that indicates whether the archive contains a value for a given key within the current decoding scope.

- decodeBoolForKey:

Decodes a Boolean value associated with a given key.

- decodeBytesForKey:returnedLength:

Decodes a stream of bytes associated with a given key.

- decodeDoubleForKey:

Decodes a double-precision floating-point value associated with a given key.

- decodeFloatForKey:

Decodes a single-precision floating-point value associated with a given key.

- decodeIntForKey:

Decodes an integer value associated with a given key.

- decodeInt32ForKey:

Decodes a 32-bit integer value associated with a given key.

- decodeInt64ForKey:

Decodes a 64-bit integer value associated with a given key.

- decodeObjectForKey:

Decodes and returns an object associated with a given key.

- finishDecoding

Tells the receiver that you are finished decoding objects.