An encoding method for subclasses to override to conditionally encode an object, preserving common references to it.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
In the overriding method,
object should be encoded only if it’s unconditionally encoded elsewhere (with any other
This method must be matched by a subsequent
decode message. Upon decoding, if
object was never encoded unconditionally,
nil in place of
object. However, if
object was encoded unconditionally, all references to
object must be resolved.
NSCoder’s implementation simply invokes