---
title: "initWithReceivePort:sendPort:components:"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsportcoder/initwithreceiveport:sendport:components:"
---

# initWithReceivePort:sendPort:components:

Initializes and returns an NSPortCoder object.

## Declaration

```occ
- (id) initWithReceivePort:(NSPort *) rcvPort sendPort:(NSPort *) sndPort components:(NSArray *) comps;
```

## Parameters

- `rcvPort`: The receive port.
- `sndPort`: The send port.
- `comps`: An array containing an encoded distributed objects message.

## Discussion

Discussion Initializes a newly allocated 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)

### Creating an NSPortCoder Object

- [portCoderWithReceivePort:sendPort:components:](foundation/nsportcoder/portcoderwithreceiveport:sendport:components:.md)
