Instance Method

RTFFromRange:

Returns an NSData object that contains an RTF stream corresponding to the characters and attributes within aRange, omitting any attachment characters and attributes.

Declaration

- (NSData *)RTFFromRange:(NSRange)range;

Discussion

Raises an NSRangeException if any part of aRange lies beyond the end of the receiver’s characters.

When writing data to the pasteboard, you can use the NSData object as the first argument to NSPasteboard's setData:forType: method, with a second argument of NSRTFPboardType.

See Also

Reading and writing RTF files

- readRTFDFromFile:

Attempts to read the RTFD file at path, returning YES if successful and NO if not.

- writeRTFDToFile:atomically:

Writes the receiver’s text as RTF with attachments to a file or directory at path.

- RTFDFromRange:

Returns an NSData object that contains an RTFD stream corresponding to the characters and attributes within aRange.