• 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: new to cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new to cocoa


  • Subject: Re: new to cocoa
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 16 May 2010 18:08:17 -0700

On Sun, May 16, 2010 at 5:19 PM, William Squires <email@hidden> wrote:
> I believe keys in an NSDictionary/NSMutableDictionary are NSStrings; they're
> just descriptive tags you attach (or associate) with an object (the
> "value"). What you need is

Any object can be a key in an NSDictionary, but NSDictionary always
copies its keys. Its toll--free bridged companion, CFDictionary, can
be configured to just retain/release the keys instead.

> [sourceButtonMap setObject:[NSString stringWithString:@"no"]
> forKey:[unitButton description]];

This is a bad idea. Who knows what -description returns? Using a
textual description of an object intended for debugging in place of
the actual object is needlessly complex and just plain wrong.

--Kyle Sluder
_______________________________________________

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: new to cocoa
      • From: Charles Srstka <email@hidden>
References: 
 >new to cocoa (From: Alejandro Marcos Aragón <email@hidden>)
 >Re: new to cocoa (From: William Squires <email@hidden>)

  • Prev by Date: Re: NSTreeController and remove:
  • Next by Date: Re: new to cocoa
  • Previous by thread: Re: new to cocoa
  • Next by thread: Re: new to cocoa
  • Index(es):
    • Date
    • Thread