• 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: Display RTF & RTFD file in NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display RTF & RTFD file in NSTextView


  • Subject: Re: Display RTF & RTFD file in NSTextView
  • From: Ryan Britton <email@hidden>
  • Date: Tue, 20 Sep 2005 12:33:08 -0700

Try this:  (typed in mail)

NSData *data;
NSAttributedString *content;

data = [NSData dataWithContentsOfFile:@"some/path"];

if (!data)
{
     return;
}

content = [[[NSAttributedString alloc] initWithRTF:data documentAttributes:NULL] autorelease];


[[yourTextView textStorage] setAttributedString: content];

On Sep 20, 2005, at 12:08 PM, Giovanni Donelli wrote:

Dear folks,
I am trying to display either a RTF or a RTFD file into a NSTextView.


Does anybody have a clever way to do that?

Thanks!

Giovanni
_______________________________________________
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


_______________________________________________ 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: 
 >Display RTF & RTFD file in NSTextView (From: Giovanni Donelli <email@hidden>)

  • Prev by Date: Re: Accessing international month name other than the default locale
  • Next by Date: NSPrintInfo bug?
  • Previous by thread: Display RTF & RTFD file in NSTextView
  • Next by thread: Re: Display RTF & RTFD file in NSTextView
  • Index(es):
    • Date
    • Thread