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

# canInit(with:)

Indicates whether the receiver can create an instance of itself from the data in a pasteboard.

```
class func canInit(with pasteboard: NSPasteboard) -> Bool
```

## Parameters

`pasteboard`

Pasteboard containing sound data.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> when the receiver can handle the data represented by `pasteboard`; <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

The [`NSSound`](/documentation/AppKit/NSSound) method is used to find out whether the class can handle the data in `pasteboard`.

## See Also

  [Sound Programming Topics for Cocoa](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Sound/Sound.html#//apple_ref/doc/uid/10000104i)



---

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)