• 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: NSForegroundColorAttributeName without AppKit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSForegroundColorAttributeName without AppKit


  • Subject: Re: NSForegroundColorAttributeName without AppKit
  • From: Graham Cox <email@hidden>
  • Date: Tue, 2 Mar 2010 14:51:59 +1100

On 02/03/2010, at 2:39 PM, Steven Degutis wrote:

> NSAttributedString is part of Foundation.framework and so are all NSStrings
> (including literal constants like @"NSColor"). Thus, you can use that safely
> without linking against AppKit.framework; however, I advise against using
> string literals in place of Apple's constants, since they might change under
> your nose.


It's a good idea to use the constant where possible, but Apple couldn't just change it without breaking binary compatibility, so it should be safe to use the literal @"NSColor" in this case, if the constant itself is defined in AppKit.

>> Unfortunately it seems that using the @"NSColor" key as part of an
>> NSAttributedString also requires AppKit. Put another way, I can't see any
>> way to draw multi-colored text in a wrapping text field without using
>> AppKit.
>

Yes, all the attributed string DRAWING functions are in AppKit, but so is NSTextField. Foundation provides the existence of NSAttributedString (the data model, if you like) but not the view or UI related aspects of it.

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

  • Follow-Ups:
    • Re: NSForegroundColorAttributeName without AppKit
      • From: Ken Ferry <email@hidden>
References: 
 >Re: NSForegroundColorAttributeName without AppKit (From: BareFeet <email@hidden>)
 >Re: NSForegroundColorAttributeName without AppKit (From: Steven Degutis <email@hidden>)

  • Prev by Date: Re: NSForegroundColorAttributeName without AppKit
  • Next by Date: Re: NSForegroundColorAttributeName without AppKit
  • Previous by thread: Re: NSForegroundColorAttributeName without AppKit
  • Next by thread: Re: NSForegroundColorAttributeName without AppKit
  • Index(es):
    • Date
    • Thread