---
title: "portCoderWithReceivePort:sendPort:components:"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsportcoder/portcoderwithreceiveport:sendport:components:"
---

# portCoderWithReceivePort:sendPort:components:

Creates and returns a new NSPortCoder object.

## Declaration

```occ
+ (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

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

### Related Documentation

- [dispatch](foundation/nsportcoder/dispatch.md)
- [Distributed Objects Programming Topics](apple-archive/documentation/Cocoa/Conceptual/DistrObjects.md)

### Creating an NSPortCoder Object

- [initWithReceivePort:sendPort:components:](foundation/nsportcoder/initwithreceiveport:sendport:components:.md)
