Instance Method

setData:forType:

Sets the given data as the representation for the specified type for the first item on the receiver.

Declaration

- (BOOL)setData:(NSData *)data forType:(NSPasteboardType)dataType;

Parameters

data

The data to write to the pasteboard.

dataType

The type of data in the data parameter. The type must have been declared by a previous declareTypes:owner: message.

Return Value

YES if the data was written successfully, otherwise NO if ownership of the pasteboard has changed. Any other error raises an NSPasteboardCommunicationException.

See Also

Writing Data

- clearContents

Clears the existing contents of the pasteboard

- writeObjects:

Writes an array of objects to the receiver.

- setPropertyList:forType:

Sets the given property list as the representation for the specified type for the first item on the receiver.

- setString:forType:

Sets the given string as the representation for the specified type for the first item on the receiver.