• 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: Where is the Computer Image ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where is the Computer Image ?


  • Subject: Re: Where is the Computer Image ?
  • From: "Michael Ash" <email@hidden>
  • Date: Mon, 15 Dec 2008 14:53:19 -0500

On Mon, Dec 15, 2008 at 1:35 PM, Clark Cox <email@hidden> wrote:
> On Mon, Dec 15, 2008 at 7:52 AM, Benjamin Dobson
> <email@hidden> wrote:
>> The image is already in Cocoa, named NSComputer.
>
> Don't use that name directly in your code, it's best to use the named
> constant: NSImageNameComputer.

Note that in this case, the major reason to use the constant is not
present: The constant is guaranteed to resolve to @"NSComputer", so
it's safe to use it that way. (This is done so that these images can
be used in nibs. Without guaranteed names you'd have to set them up in
code later.)

This guarantee does not apply to string constants in general, of
course! These NSImage constants are specifically guaranteed in the
docs. Other constants aren't, so if you look up what they point to and
use that string directly, you could break at any time!

Of course you're still correct that it's best to use the constant in
your code, simply because it's less typo-prone and works better with
various code editing tools. I just wanted to point out that it's not a
compatibility issue the way it is with others.

Mike
_______________________________________________

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: 
 >Where is the Computer Image ? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Where is the Computer Image ? (From: Benjamin Dobson <email@hidden>)
 >Re: Where is the Computer Image ? (From: "Clark Cox" <email@hidden>)

  • Prev by Date: Re: View Swapping
  • Next by Date: Re: What is the default type for an integer literal (as relates to its use in NSLog)?
  • Previous by thread: Re: Where is the Computer Image ?
  • Next by thread: Toolbar View Item Size
  • Index(es):
    • Date
    • Thread