<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPasteboard/withUniqueName()",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPasteboard(cm)pasteboardWithUniqueName"
  },
  "title" : "withUniqueName()"
}
-->

# withUniqueName()

Creates and returns a new pasteboard with a name that is guaranteed to be unique with respect to other pasteboards in the system.

```
class func withUniqueName() -> NSPasteboard
```

## Return Value

The new pasteboard object.

## Discussion

This method is useful for apps that implement their own interprocess communication using pasteboards. Because the lifetime of a unique pasteboard is not related to the lifetime of the creating app, you must release a unique pasteboard by calling [`releaseGlobally()`](/documentation/AppKit/NSPasteboard/releaseGlobally()) to avoid possible leaks.

---

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)