Instance Method

readSelectionFromPasteboard:

Reads the text view’s preferred type of data from the specified pasteboard.

Declaration

- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard;

Parameters

pboard

The pasteboard to read from.

Return Value

YES if the data was successfully read, NO otherwise.

Discussion

This method invokes the preferredPasteboardTypeFromArray:restrictedToTypesFromArray: method to determine the text view’s preferred type of data and then reads the data using the readSelectionFromPasteboard:type: method.

You should not need to override this method. You might need to invoke this method if you are implementing a new type of pasteboard to handle services other than copy/paste or dragging.

See Also

Managing the Pasteboard

- preferredPasteboardTypeFromArray:restrictedToTypesFromArray:

Returns whatever type on the pasteboard would be most preferred for copying data.

- readSelectionFromPasteboard:type:

Reads data of the given type from the specified pasteboard.

readablePasteboardTypes

The types this text view can read immediately from the pasteboard.

writablePasteboardTypes

The pasteboard types that can be provided from the current selection.

- writeSelectionToPasteboard:type:

Writes the current selection to the specified pasteboard using the given type.

- writeSelectionToPasteboard:types:

Writes the current selection to the specified pasteboard under each given type.

- validRequestorForSendType:returnType:

Returns self if the text view can provide and accept the specified data types, or nil if it can't.