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

Getting the Connection

Encoding NSPort Objects

Checking for Encoding

Dispatching

Instance Methods

decodePortObject

Decodes and returns an NSPort object that was previously encoded with any of the general encode...Object: messages.

- (NSPort *)decodePortObject
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.h

encodePortObject:

Encodes a given port so it can be properly reconstituted in the receiving process or thread.

- (void)encodePortObject:(NSPort *)aPort
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.h

isBycopy

Returns a Boolean value that indicates whether the receiver is encoding an object by copying it.

- (BOOL)isBycopy
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.h

isByref

Returns a Boolean value that indicates whether the receiver is encoding an object by reference.

- (BOOL)isByref
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