Returns the data for the specified type from the first item in the receiver that contains the type.
- macOS 10.0+
A data object containing the data for the specified type from the first item in the receiver that contains the type, or
nil if the contents of the pasteboard changed since they were last checked.
This method may also return
nil if the pasteboard server cannot supply the data in time—for example, if the pasteboard’s owner is slow in responding to a
pasteboard: message and the interprocess communication times out.
Errors other than a timeout raise an
nil is returned, the application should put up a panel informing the user that it was unable to carry out the paste operation. Note that sending
available before invoking
data can help you determine whether a
nil result from a reading method is due to something like a pasteboard timeout.
For standard text data types such as string, RTF, and RTFD, the text data from each item is returned as one combined result separated by newlines.