• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextView with RTF as string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSTextView with RTF as string?
      • From: John Timmer <email@hidden>
    • Re: NSTextView with RTF as string?
      • From: j o a r <email@hidden>
    • Re: NSTextView with RTF as string?
      • From: Nicko van Someren <email@hidden>
  • Prev by Date: Re: NSTextView getting the cursor col/row
  • Next by Date: Re: NSTextView with RTF as string?
  • Previous by thread: Re: Function to write to one pixel?
  • Next by thread: Re: NSTextView with RTF as string?
  • Index(es):
    • Date
    • Thread