<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.0.0 - 10.7.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSPortCoder/portCoderWithReceivePort:sendPort:components:",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPortCoder(cm)portCoderWithReceivePort:sendPort:components:"
  },
  "title" : "portCoderWithReceivePort:sendPort:components:"
}
-->

# portCoderWithReceivePort:sendPort:components:

Creates and returns a new `NSPortCoder` object.

```
+ (id) portCoderWithReceivePort:(NSPort *) rcvPort sendPort:(NSPort *) sndPort components:(NSArray *) comps;
```

## Parameters

`rcvPort`

The receiver port.

`sndPort`

The send port.

`comps`

An array containing an encoded distributed objects message.

## Return Value

A new `NSPortCoder` object connected to the communication ports `rcvPort` and `sndPort`, with an encoded distributed objects message stored in `comps`.

## See Also

[`- (void) dispatch;`](/documentation/Foundation/NSPortCoder/dispatch)

Processes and acts upon the distributed object message with which the receiver was initialized.

  [Distributed Objects Programming Topics](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/DistrObjects/DistrObjects.html#//apple_ref/doc/uid/10000102i)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)