---
title: NSPortCoder
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsportcoder
---

# NSPortCoder

A coder used to transmit object proxies (and sometimes objects themselves) between connections.

## Declaration

```occ
@interface NSPortCoder : NSCoder
```

## Overview

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.

## Topics

### Creating an NSPortCoder Object

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

### Getting the Connection

- [connection](foundation/nsportcoder/connection.md)

### Encoding NSPort Objects

- [encodePortObject:](foundation/nsportcoder/encodeportobject:.md)
- [decodePortObject](foundation/nsportcoder/decodeportobject.md)

### Checking for Encoding

- [isBycopy](foundation/nsportcoder/isbycopy.md)
- [isByref](foundation/nsportcoder/isbyref.md)

### Dispatching

- [dispatch](foundation/nsportcoder/dispatch.md)

## Relationships

### Inherits From

- [NSCoder](foundation/nscoder.md)

## See Also

### Legacy

- [NSMachPortDelegate](foundation/nsmachportdelegate.md)
- [NSConnectionDelegate](foundation/nsconnectiondelegate.md)
- [NSConnection](foundation/nsconnection.md)
- [NSDistantObject](foundation/nsdistantobject.md)
- [NSDistantObjectRequest](foundation/nsdistantobjectrequest.md)
- [NSMachBootstrapServer](foundation/nsmachbootstrapserver.md)
- [NSMachPort](foundation/nsmachport.md)
- [MessagePort](foundation/messageport.md)
- [NSMessagePortNameServer](foundation/nsmessageportnameserver.md)
- [PortDelegate](foundation/portdelegate.md)
- [PortMessage](foundation/portmessage.md)
- [NSPortNameServer](foundation/nsportnameserver.md)
- [NSProtocolChecker](foundation/nsprotocolchecker.md)
- [NSSocketPortNameServer](foundation/nssocketportnameserver.md)
