On Jul 28, 2008, at 3:29 PM, Jonathan Hess wrote:
On Jul 28, 2008, at 11:44 AM, I. Savant wrote:

If I wanted to store an object in a dictionary and set its key as the
object's memory address - how would I go about doing this?

I'm racking my brains trying to think of a good reason to do this and am
drawing a blank. I can, however, think of myriad bad reasons.

A good reason would be that you care about identity equality and not value equality. You care that the key is the exact same instance, not that it is an equivalent instance. (== vs isEqual:)

Ah, good point -- that would rule out my NSSet idea.

--Andy

Another reason would be that the keys might not implement NSCopying, which NSDictionary requires.

Jon Hess



Agreed - I can't help but wonder about class clusters but I can't
think of a direct reason why this would be a 'problem area'. It's just
the first thing that popped into my head. :-)

--
I.S.
_______________________________________________

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/jhess%40apple.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

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/aglee%40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to