• 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: 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

References: 
 >new to cocoa (From: Alejandro Marcos Aragón <email@hidden>)
 >Re: new to cocoa (From: William Squires <email@hidden>)
 >Re: new to cocoa (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: new to cocoa
  • Next by Date: Re: creating a UITableView on an "Utility application" project
  • Previous by thread: Re: new to cocoa
  • Next by thread: Re: new to cocoa
  • Index(es):
    • Date
    • Thread