Scans the specified types for a type that the receiver supports.
- macOS 10.0+
An array of
NSStringobjects specifying the pasteboard types your application supports, in preferred order.
The first pasteboard type in
types that is available on the pasteboard, or
nil if the receiver does not contain any of the types in
You use this method to determine the best representation available on the pasteboard. For example, if your application supports RTFD, RTF, and string data, then you might invoke the method as follows:
If the pasteboard contains RTF and string data, then
best would contain
NSRTFPboard. If the pasteboard contains none of the types in
best would be
You must send a
available message before reading any data from an
NSPasteboard object. If you need to see if a type in the returned array matches a type string you have stored locally, use the
is method to perform the comparison.