On Jan 19, 2010, at 10:46 AM, Kirk Kerekes wrote:

NSDictionary will use almost any object as a key:

From the docs:
"In general, a key can be any object (provided that it conforms to the NSCopying protocol...)"

-- and if it is an immutable object, that -copy is just a -retain.

Yes, but he said he wants to use a view as the key. Views are not immutable, and do copy themselves in response to -copy. Having a dictionary whose key objects are copies of your live views is not very useful. (Especially since the copied view will have a different hashcode from the original one, so you can't even look it up using the original view anymore...)

—Jens_______________________________________________

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