The pasteboard that requires the specified data for a paste operation.
pasteboard:provideDataForType:
Availability
- macOS 10.0–11.0 Deprecated
Technology
- App
Kit
Declaration 宣言
- (void)pasteboard:(NSPasteboard
*)sender
provideDataForType:(NSPasteboardType
)type;
Parameters パラメータ
sender
type
The type of data the owner object must provide.
Discussion 解説
The receiver should have been previously declared in a declare
message.
The requested data should be written to sender
using the set
, set
, or set
method. The pasteboard:
messages may also be sent to the owner when the application is shut down through an application’s terminate:
method. This is the method that is invoked in response to a Quit command. Thus the user can copy something to the pasteboard, quit the application, and still paste the data that was copied. A pasteboard:
message is sent only if the specified type of data has not already been supplied to the pasteboard. Instead of writing all data types when the cut or copy operation is done, an application can choose to implement this method to provide the data for certain types only when they are requested.
If an application writes data to the pasteboard in the richest, and therefore most preferred, type at the time of a cut or copy operation, its pasteboard:
method can simply read that data from the pasteboard, convert it to the requested type, and write it back to the pasteboard as the new type.