Instance Method


Writes the contents of the specified file to the pasteboard.


- (BOOL)writeFileContents:(NSString *)filename;



The name of the file to write to the pasteboard.

Return Value

YES if the data was successfully written, otherwise NO.


Writes the contents of the file filename to the receiver and declares the data to be of type NSFileContentsPboardType and also of a type appropriate for the file’s extension (as returned by the NSCreateFileContentsPboardType function when passed the files extension), if it has one.

See Also

Writing Data (OS X v10.5 and Earlier)

- declareTypes:owner:

Prepares the receiver for a change in its contents by declaring the new types of data it will contain and a new owner.

- addTypes:owner:

Adds promises for the specified types to the first pasteboard item.

- writeFileWrapper:

Writes the serialized contents of the specified file wrapper to the pasteboard.