RE: Document-specific data with RTFs
RE: Document-specific data with RTFs
- Subject: RE: Document-specific data with RTFs
- From: "Joshua D. Orr" <email@hidden>
- Date: Sun, 2 Jun 2002 12:07:20 -0600
You can make an NSAttributedString, and change anything you want there
(thats what I do, I make an NSAttributedString and change all the
attributes around then make a RTF out of it).
Here some code that lets you turn an NSAttributedString to RTF data.
- (void)setTextView:(id)theTextView
withAttributedString:(NSAttributedString *)theString
{
int theTextViewLength = [[theTextView string] length];
int theStringLength = [theString length];
NSData *theRTFData = [theString RTFFromRange:NSMakeRange(0,
theStringLength) documentAttributes:nil];
[theTextView replaceCharactersInRange:NSMakeRange(0,
theTextViewLength) withRTF:theRTFData];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.