Overridden by subclasses to substitute another object or a copy for itself during distribution encoding.
- macOS 10.0–10.13Deprecated
The port coder encoding the receiver.
The object encode instead of the receiver (if different).
This method is invoked by
NSObject’s implementation returns an
NSDistant object for the object returned by
replacement, enabling all objects to be distributed by proxy as the default. However, if
NSObject’s implementation will also return
Subclasses that want to be passed by copy instead of by reference must override this method and return
self. The following example shows how to support object replacement both by copy and by reference: