• 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: John Hörnkvist <email@hidden>
  • Date: Mon, 28 Jan 2002 20:00:28 +0100

On Monday, January 28, 2002, at 07:21 PM, Chris Gehlker wrote:

The docs say that any class that implements NSCopying can provide keys for
NSDictionary. Hillegass says the keys must be NSString. I've had bad luck
with anything that should work, like NSNumber. So are they docs just wrong
here?

Anything can be a key if it implements NSCopying and
[a isEqual:b] => [a hash]==[b hash]

Note that for NSObject hash and equality are based on the memory address only.

Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com


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

  • Prev by Date: Re: Setting desktop background from application
  • Next by Date: Re: How viable is Cocoa development?
  • Previous by thread: 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