Instance Method

writeSelectionToPasteboard:type:

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

Declaration

- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard type:(NSPasteboardType)type;

Parameters

pboard

The pasteboard to write to.

type

The type of data to write.

Return Value

YES if the data was successfully written, NO otherwise.

Discussion

The complete set of data types being written to pboard should be declared before invoking this method.

This method should be invoked only from writeSelectionToPasteboard:types:. You can override this method to add support for writing new types of data to the pasteboard. You should invoke super’s implementation of the method to handle any types of data your overridden version does not.

See Also

Managing the Pasteboard

- preferredPasteboardTypeFromArray:restrictedToTypesFromArray:

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

- readSelectionFromPasteboard:

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

- 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: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.