<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPasteboard/addTypes(_:owner:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPasteboard(im)addTypes:owner:"
  },
  "title" : "addTypes(_:owner:)"
}
-->

# addTypes(_:owner:)

Adds promises for the specified types to the first pasteboard item.

```
func addTypes(_ newTypes: [NSPasteboard.PasteboardType], owner newOwner: Any?) -> Int
```

## Parameters

`newTypes`

An array of `NSString` objects, each of which specifies a type of data that can be provided to the pasteboard.

`newOwner`

The object that provides the data for the specified types.

    If the data for those types is provided immediately, the owner can be     `nil`    . If the data for the added types will be provided lazily when requested from the pasteboard, an owner object must be provided that implements the -    <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/pasteboard:provideDataForType:>     method of the     `NSPasteboardOwner`     informal protocol.

## Return Value

The new change count, or `0` if there was an error adding the types.

## Discussion

This method adds promises for the specified types to the first pasteboard item.

You use this methods to declare additional types of data for the first pasteboard item in the receiver. You can also use it to replace existing types added by a previous [`declareTypes(_:owner:)`](/documentation/AppKit/NSPasteboard/declareTypes(_:owner:)) or [`addTypes(_:owner:)`](/documentation/AppKit/NSPasteboard/addTypes(_:owner:)) message.

The `newTypes` parameter specifies the types of data you are promising to the pasteboard. The types should be ordered according to the preference of the source application, with the most preferred type coming first (typically, the richest representation). New types are added to the end of the list containing any existing types, if any.

If you specify a type that has already been declared, this method replaces the owner of that type with the value in `newOwner`. In addition, any data already written to the pasteboard for that type is removed.

## See Also

[`changeCount`](/documentation/AppKit/NSPasteboard/changeCount)

The receiver’s change count.



---

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)