Re: NSTextView with RTF as string?
Re: NSTextView with RTF as string?
- Subject: Re: NSTextView with RTF as string?
- From: John Timmer <email@hidden>
- Date: Fri, 06 May 2005 14:35:01 -0400
Title: Re: NSTextView with RTF as string?
My intention for this is to build a table with a number of rows that I can determine programmatically using RTF. There doesn’t seem to be a way to control tables in a text view programmatically, so I figured i’d have to manipulate the contents more directly – I decided to just work with the contents of a template file. I found that if you delete the “\lastrow” tag, you can insert another row beneath it and close that with \lastrow.
The reason I asked the question that I did was that I apparently had the process working, as evidenced by dumping the string to the file. I just can’t seem to get them back into a text view for user view/editing afterwards. I guess I could figure out the ranges for the appropriate data and manipulate the RTF as data, see if table attributes are maintained when attributed strings are formed out of RTF and work with that formatting, or just give up and go with HTML.
JT
You should make the NSData of the RTF text using RTFFromRange:documentAttributes: rather from the UTF8 string. The two codings are completely different.
That said, why not just use use replaceCharactersInRange:withAttributedString: on the NSTextStorage of the view?
_______________________________________________
This mind intentionally left blank
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden