On Sun, May 16, 2010 at 5:19 PM, William Squires <wsqui...@satx.rr.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to