NSConnection object initialized with given send and receive ports.
- macOS 10.0–10.13Deprecated
The receive port for the new connection.
The send port for the new connection.
NSConnection object initialized with
send. The returned object might be different than the original receiver.
NSConnection object adds
receive to the current
NSRun object with
NSDefault as the mode. If the application doesn’t use an
NSApplication object to handle events, it needs to run the
NSRun object with one of its various
This method posts an
NSConnection once the connection is initialized.
send parameters affect initialization as follows:
NSConnectionobject with the same ports already exists, returns it and discards the original receiver.
NSConnectionobject exists that uses the same ports, but switched in role, then the new
NSConnectionobject communicates with it. Messages sent to a proxy held by either connection are forwarded through the other
NSConnectionobject. This rule applies both within and across address spaces.
This behavior is useful for setting up distributed object connections between threads within an application. See Distributed Objects Programming Topics for more information.
nil, deallocates the receiver and returns
NSConnectionobject allocates and uses a new port of the same class as
nilor if both ports are the same, the
receivefor both sending and receiving and is useful only for vending an object. Use
rootto vend an object.
NSConnectionobject exists that uses
receiveas both of its ports, it’s treated as the parent of the new
NSConnectionobject, and its root object and all its configuration settings are applied to the new
NSConnectionobject. You should neither register a name for nor set the root object of the new
NSConnectionobject. See Configuring a Connection for more information.
sendare different and neither is shared with another
NSConnectionobject, the receiver can be used to vend an object as well as to communicate with other
NSConnectionobjects. However, it has no other
NSConnectionobject to communicate with until one is set up.
receiveparameter can’t be shared by
NSConnectionobjects in different threads.
This method is the designated initializer for the