Re: Displaying HTML in an NSTextView
Re: Displaying HTML in an NSTextView
- Subject: Re: Displaying HTML in an NSTextView
- From: Douglas Davidson <email@hidden>
- Date: Fri, 6 May 2005 15:16:36 -0700
On May 6, 2005, at 2:55 PM, Seth Willits wrote: I have an NSTextView subclass that I wish to use to display HTML. The HTML comes from a String and not a URL. I cannot work out the correct way to do this.
Well for starters, NSTextViews don't render HTML. I suggest you look at WebKit.
NSTextViews do not and are not intended to render HTML as a browser would. However, they do and will import HTML, preserving those attributes that are relevant and appropriate in a rich text setting. For Tiger they also export HTML in a variety of forms under similar constraints.
The relevant methods are on NSAttributedString and NSMutableAttributedString, such as initWithHTML:options:documentAttributes:, initWithData:options:documentAttributes:error:, dataFromRange:documentAttributes:error:, etc.
Douglas Davidson
|
_______________________________________________
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