• 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: NSAttributtedString initWithHTML skip styles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSAttributtedString initWithHTML skip styles (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: NSAttributtedString initWithHTML skip styles
  • Next by Date: iPhone: badge icon for a button in toolbar
  • Previous by thread: NSAttributtedString initWithHTML skip styles
  • Next by thread: Re: NSAttributtedString initWithHTML skip styles
  • Index(es):
    • Date
    • Thread