• 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
Re: How do I display RTF Data?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I display RTF Data?


  • Subject: Re: How do I display RTF Data?
  • From: Mark Williams <email@hidden>
  • Date: Sat, 8 Jul 2006 00:04:55 -0700

Because I often search the list archives for my information as some one else might. And because some one else might want to know the answer to my question as i found it. I will post the link I used and how I managed to solve this issue.

http://developer.apple.com/samplecode/FancyAbout/listing7.html

That is a link to some sample code that showed me how to read an rtf file and then display it correctly in a text view.

Basically I read the file in to an NSData object, initialized an NSAttributedString with that NSData object [[NSAttributedString alloc] initWithRTF:myObject documentAttributes:NULL] and then used [[textView textStorage] setAttribtedString:myAtribString] to display the data.

Looking back on it now the answer was simple but with a huge update to the project I was working on this simple answer did not seem so at the time.

On Jul 7, 2006, at 10:04 AM, mmalc crawford wrote:


On Jul 6, 2006, at 3:49 PM, Mark Williams wrote:

I have a window with an NSTextView. Data is read from an rtf file and should be displayed in this textview. The problem is that I do not know how to display rtf data (as it was formated when the file was made.) in a window. Would some one be able to help me with this?

The answer to this is trivially found in the documentation -- try, for example, <http://developer.apple.com/cgi-bin/search.pl? q=NSTextView+rtf&num=10&site=default_collection>.


Members of the list are expected to expend reasonable effort in finding an answer to their question before posting.

mmalc




_______________________________________________ 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
References: 
 >How do I display RTF Data? (From: Mark Williams <email@hidden>)
 >Re: How do I display RTF Data? (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Hardware Clock
  • Next by Date: Re: [newbie]How to pop a window?
  • Previous by thread: Re: How do I display RTF Data?
  • Next by thread: [Moderator] List guidelines and related resources
  • Index(es):
    • Date
    • Thread