Re: Re: Objects as keys NSMutableDictionary
Re: Re: Objects as keys NSMutableDictionary
- Subject: Re: Re: Objects as keys NSMutableDictionary
- From: "Shawn Erickson" <email@hidden>
- Date: Mon, 10 Jul 2006 09:00:59 -0700
On 7/10/06, Adam R. Maxwell <email@hidden> wrote:
On Jul 10, 2006, at 06:43, Rosyna wrote:
> As, I see. NSCFDictionary explicitly calls copyWithZone: before
> setting the key using CFDictionarySetValue(). I wonder why.
Yes, and that wasn't expected behavior in my case; perhaps it does
this because Keys Are Always NSStrings?
It does the copy because it doesn't want the key object to change
while being used as a key. Of course the general assumption is that
the objects you are using as a key are not using pointer comparison in
isEqual: or when generating hash.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden