• 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: Re: Objects as keys NSMutableDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Objects as keys NSMutableDictionary (From: email@hidden)
 >Re: Objects as keys NSMutableDictionary (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Objects as keys NSMutableDictionary (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Re: where have all the IVARS gone? (long time passing...)
  • Next by Date: Re: Objects as keys NSMutableDictionary
  • Previous by thread: Re: Re: Objects as keys NSMutableDictionary
  • Next by thread: programatically printing to a postscript file
  • Index(es):
    • Date
    • Thread