Instance Property

types

An array of the receiver’s supported data types.

Declaration

@property(readonly, copy) NSArray<NSPasteboardType> *types;

Discussion

The types array is an array of NSString objects containing the union of the types of data declared for all the pasteboard items on the receiver. The returned types are listed in the order they were declared. It’s a good idea to check the value of types (or call availableTypeFromArray:) before reading any data from an NSPasteboard object. If you need to see if a type in the types array matches a type string you have stored locally, use the isEqualToString: method to perform the comparison.

See Also

Validating Contents

- availableTypeFromArray:

Scans the specified types for a type that the receiver supports.

- canReadItemWithDataConformingToTypes:

Returns a Boolean value that indicates whether the receiver contains any items that conform to the specified UTIs.

- canReadObjectForClasses:options:

Returns a Boolean value that indicates whether the receiver contains any items that can be represented as an instance of any class in a given array.

+ typesFilterableTo:

Returns the data types that can be converted to the specified type using the available filter services.