Contents

decodeObjectOfClass:forKey:

Decodes an object for the key, restricted to the specified class.

Declaration

- (id) decodeObjectOfClass:(Class) aClass forKey:(NSString *) key;

Parameters

  • aClass:

    The expect class type.

  • key:

    The coder key.

Return Value

The decoded object.

Discussion

If the coder responds true to requiresSecureCoding, then an exception will be thrown if the class to be decoded does not implement NSSecureCoding or is not isKind(of:) of aClass.

If the coder responds false to requiresSecureCoding, then the class argument is ignored and no check of the class of the decoded object is performed, exactly as if decodeObject(forKey:) had been called.

See Also

Decoding General Data