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

Re: Objects as keys NSMutableDictionary


  • Subject: Re: Objects as keys NSMutableDictionary
  • From: Rosyna <email@hidden>
  • Date: Mon, 10 Jul 2006 07:19:26 -0700

Well, if it assumed the keys were always strings, then it would just use kCFCopyStringDictionaryKeyCallBacks when creating the internal CFDictionary. In which case this would make the copyWithZone: a useless extra step. It's also why I mistakenly assumed that creating the NSDictionary with the CF call using different callbacks would address this issue.

Well, at least the documentation for setObject:forKey: explicitly says that the key must respond to copyWithZone:. In these cases, it might just be best to return [self retain] or something.

Ack, at 7/10/06, Adam R. Maxwell said:

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? My bug report disappeared into the black hole of "Duplicate" so I'll never know, but I'm glad Mike Ash pointed this out a few weeks ago.

--


Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
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


  • Follow-Ups:
    • Re: Objects as keys NSMutableDictionary
      • From: Adam Maxwell <email@hidden>
References: 
 >Re: Objects as keys NSMutableDictionary (From: James Bucanek <email@hidden>)
 >Re: Objects as keys NSMutableDictionary (From: email@hidden)
 >Re: Objects as keys NSMutableDictionary (From: Rosyna <email@hidden>)
 >Re: Objects as keys NSMutableDictionary (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Objects as keys NSMutableDictionary (From: Rosyna <email@hidden>)
 >Re: Objects as keys NSMutableDictionary (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Creating PDF file attachments
  • Next by Date: clicking in text
  • Previous by thread: Re: Objects as keys NSMutableDictionary
  • Next by thread: Re: Objects as keys NSMutableDictionary
  • Index(es):
    • Date
    • Thread