Instance Method

setString:forType:

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

Declaration

- (BOOL)setString:(NSString *)string forType:(NSPasteboardType)dataType;

Parameters

string

The string to write to the pasteboard.

dataType

The type of string data. 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.

Discussion

This method invokes setData:forType: to perform the write.

See Also

Writing Data

- clearContents

Clears the existing contents of the pasteboard

- writeObjects:

Writes an array of objects to the receiver.

- setData:forType:

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

- setPropertyList:forType:

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