• 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
Newbie:Attributed Text Strings and NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie:Attributed Text Strings and NSTextView


  • Subject: Newbie:Attributed Text Strings and NSTextView
  • From: Clayton Leitch <email@hidden>
  • Date: Fri, 24 Sep 2004 09:31:45 -0400

I have a program with two NSTextViews. The first NSTextView holds a simple NSString. This one works great. The second NSTextView holds an attributed string (or at least it should) that changes the display font. Two problems have happened. I initialize the NSAttributedString with the NSString used to fill the first NSTextView. Then I use the NSFont class to create a font object I attempt to use a font with the name Arial. Obviously I have constructed this call wrong since it fails to compile. Next when I attempt to use the addAttribute I am told that stringTest will not respond to the addAttribute method. Last I have failed to find the method to set the contents of the testList NSTextView to the testString. Source code shown below.

Thanks
newFont = [fontWithName:@"Arial" size:24];
stringTest = [[NSMutableAttributedString alloc] initWithString:stringNumber];
[stringTest addAttribute:NSFontAttributeName
value:[newFont userFontSize:24]];
[testList setString:stringTest];
 _______________________________________________
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

  • Follow-Ups:
    • Re: Newbie:Attributed Text Strings and NSTextView
      • From: Fritz Anderson <email@hidden>
    • Re: Newbie:Attributed Text Strings and NSTextView
      • From: Tony Cate <email@hidden>
  • Prev by Date: Re: Add duplicate menu items
  • Next by Date: Re: Is _objc_flush_caches_(Class) necessary to swizzle methods?
  • Previous by thread: Re: ATSUI Performance Problem...
  • Next by thread: Re: Newbie:Attributed Text Strings and NSTextView
  • Index(es):
    • Date
    • Thread