Re: new to cocoa
Re: new to cocoa
- Subject: Re: new to cocoa
- From: Charles Srstka <email@hidden>
- Date: Sun, 16 May 2010 20:15:48 -0500
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 (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