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

# servicePortWithName:

Looks up and returns the port for the vended service that is registered under the specified name.

```
- (NSPort *) servicePortWithName:(NSString *) name;
```

## Parameters

`name`

The name of the vended service.

## Return Value

The port associated with `name`. Returns `nil` if no such port exists.

---

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)