• 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: What's the Real Story on Keys for NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the Real Story on Keys for NSDictionary


  • Subject: Re: What's the Real Story on Keys for NSDictionary
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 28 Jan 2002 20:21:33 +0100

Chris,

>>>>>> Chris Gehlker (CG) wrote at Mon, 28 Jan 2002 11:21:09 -0700:
CG> The docs say that any class that implements NSCopying can provide keys
CG> for NSDictionary. Hillegass says the keys must be NSString. I've had bad
CG> luck with anything that should work, like NSNumber. So are they docs just
CG> wrong here?

You need NSCopying and reasonable hash. With that, it *always* worked for me
well. Beside NSNumbers I've used small arrays and dictionaries (witch
re-implemented hash) as keys as well, and couple of times my own objects too.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc


References: 
 >What's the Real Story on Keys for NSDictionary (From: Chris Gehlker <email@hidden>)

  • Prev by Date: Re: How ATTRACTIVE is CoCoa development?
  • Next by Date: Re: SBook5
  • Previous by thread: Re: What's the Real Story on Keys for NSDictionary
  • Next by thread: Re: What's the Real Story on Keys for NSDictionary
  • Index(es):
    • Date
    • Thread