Re: NSAttributtedString initWithHTML skip styles
Re: NSAttributtedString initWithHTML skip styles
- Subject: Re: NSAttributtedString initWithHTML skip styles
- From: Graham Cox <email@hidden>
- Date: Thu, 11 Feb 2010 21:53:42 +1100
On 11/02/2010, at 9:45 PM, Gustavo Pizano wrote:
> [(XWSDefaultComponentView *)[component view] setString:[valueString string]];
>
>
> But when I display the NSTextViuew all the string its without any style, no bold, no colors no nothing..
>
> Any ideas what might I being doing wrong?
Sure. You're calling -setString: on the text view with just the string part of the attributed string you've carefully built. So all the attributes are getting discarded.
You need to do something like this:
[textView setRichText:YES];
[[textView textStorage] setAttributedString:valueString];
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden