<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 - 13.1.0",
    "macOS: 10.0.0 - 10.13.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMachBootstrapServer/registerPort:name:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMachBootstrapServer(im)registerPort:name:"
  },
  "title" : "registerPort:name:"
}
-->

# registerPort:name:

Registers a port with a specified name.

```
- (BOOL) registerPort:(NSPort *) port name:(NSString *) name;
```

## Parameters

`port`

The port object to register with the bootstrap server.

`name`

The name to associate with `port`.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the registration succeeded, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

Once registered, a port cannot be unregistered; instead, you need to invalidate the port.

---

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)