Re: NSDictionary trouble
Re: NSDictionary trouble
- Subject: Re: NSDictionary trouble
- From: Jens Alfke <email@hidden>
- Date: Tue, 19 Jan 2010 15:06:59 -0800
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 (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