Re: What's the Real Story on Keys for NSDictionary
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