Adopted by: NSObject (informal protocol)
Declared in:
- AppKit/NSApplication.h
This informal protocol consists of two methods, writeSelectionToPasteboard:types: and readSelectionFromPasteboard:. The first is implemented to provide data to a remote service, and the second to receive any data the remote service might send back. Both respond to messages that are generated when the user chooses a command from the Services menu.
- (BOOL)readSelectionFromPasteboard:(NSPasteboard
*)pboard
There's no default readSelectionFromPasteboard: method. The Application Kit declares a prototype for this method, but doesn't implement it.
- (BOOL)writeSelectionToPasteboard:(NSPasteboard
*)pboard
types:(NSArray *)types
A writeSelectionToPasteboard:types: message
is sent to the first responder when the user chooses a command from
the Services menu, but only if the receiver didn't return nil
to
a previous validRequestorForSendType:returnType: message.
After this method writes the data to the pasteboard, a remote message is sent to the application that provides the service the user requested. If the service provider supplies return data to replace the selection, the first responder will then receive a readSelectionFromPasteboard: message.
There's no default writeSelectionToPasteboard:types: method. The Application Kit declares a prototype for this method, but doesn't implement it.
See Also: - validRequestorForSendType:returnType: (NSResponder class)