NSPortCoder Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSPortCoder.h |
Overview
NSPortCoder is a concrete subclass of NSCoder used in the distributed objects system to transmit object proxies (and sometimes objects themselves) between NSConnection objects. An NSPortCoder instance is always created and used by an NSConnection object; you should never need to explicitly create or use one directly yourself.
Tasks
Creating an NSPortCoder Object
-
+ portCoderWithReceivePort:sendPort:components:Deprecated in OS X v10.7 -
– initWithReceivePort:sendPort:components:Deprecated in OS X v10.7
Getting the Connection
-
– connectionDeprecated in OS X v10.7
Encoding NSPort Objects
Checking for Encoding
Dispatching
-
– dispatchDeprecated in OS X v10.7
Instance Methods
decodePortObject
Decodes and returns an NSPort object that was previously encoded with any of the general encode...Object: messages.
Return Value
An NSPort object that was previously encoded with any of the general encode...Object: messages.
Discussion
This method is primarily for use by NSPort objects themselves—you can always use decodeObject to decode any object.
NSPort invokes this method in its initWithCoder: method so the appropriate kernel information for the port can be decoded. A subclass of NSPortCoder shouldn’t decode an NSPort by sending it an initWithCoder: message. See Subclassing NSCoder for more information.
Availability
- Available in OS X v10.0 and later.
Declared In
NSPortCoder.hencodePortObject:
Encodes a given port so it can be properly reconstituted in the receiving process or thread.
Parameters
- aPort
The port to encode.
Discussion
This method is primarily for use by NSPort objects themselves—you can always use the general encode...Object: methods to encode any object.
NSPort invokes this method in its encodeWithCoder: method so that the appropriate kernel information for the port can be encoded. A subclass of NSPortCoder should not encode an NSPort by sending it an encodeWithCoder: message. See Subclassing NSCoder for more information.
Availability
- Available in OS X v10.0 and later.
Declared In
NSPortCoder.hisBycopy
Returns a Boolean value that indicates whether the receiver is encoding an object by copying it.
Return Value
YES if the receiver is encoding an object by copying it, NO if it expects a proxy.
Discussion
See Distributed Objects Programming Topics for more information.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSPortCoder.hisByref
Returns a Boolean value that indicates whether the receiver is encoding an object by reference.
Return Value
YES if the receiver is encoding an object byref, NO if it expects a copy.
Discussion
See Distributed Objects Programming Topics for more information.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSPortCoder.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-01-29)