On May 16, 2010, at 8:08 PM, Kyle Sluder wrote:

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

You could probably use an NSMapTable — with the appropriate options, it could 
be set to retain its keys instead of copying them. It might be a good idea to 
see if there’s a better way to do what you’re doing, though — mapping buttons 
to arbitrary objects like that doesn’t strike me as being the best way to do 
things.

Charles_______________________________________________

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