NSTextView with RTF as string?
NSTextView with RTF as string?
- Subject: NSTextView with RTF as string?
- From: John Timmer <email@hidden>
- Date: Fri, 06 May 2005 08:32:34 -0400
Title: NSTextView with RTF as string?
I've got some RTF that I've generated manipulating a string's contents in code. I need to put that into a Text View. If I try the following:
[rtfText writeToFile: [@"~/Desktop/blurk.rtf" stringByExpandingTildeInPath] atomically: YES];
[textView replaceCharactersInRange: NSMakeRange(0,0) withRTF: [NSData dataWithBytes: [rtfText UTF8String] length: [rtfText length]]];
The file I write is properly formatted RTF and opens in Text Edit as desired. The Text View, however, is filled with gibberish (properly formatted gibberish for the most part, but gibberish). Is this a problem with text encoding? Should I be using something other than UTF8String?
Thanks for any advice -
JT
_______________________________________________
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