Instance Property

decodingFailurePolicy

The action the coder should take when decoding fails.

Declaration

@property(readonly) NSDecodingFailurePolicy decodingFailurePolicy;

Discussion

A decode call can fail 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 encountering a numeric type instead. This also occurs when decodeIntegerForKey: encounters a value encoded as floating-point, or vice versa.

  • A secure coding violation occurs. This happens when you attempt to decode an object that doesn’t conform to NSSecureCoding. This also happens when the encoded type doesn’t match any of the types passed to decodeObject(of:forKey:).

See Also

Inspecting a Coder

allowsKeyedCoding

A Boolean value that indicates whether the receiver supports keyed coding of objects.

- containsValueForKey:

Returns a Boolean value that indicates whether an encoded value is available for a string.

NSDecodingFailurePolicy

Policies describing the action the coder should take when encountering decode failures.