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: Chris Gehlker <email@hidden>
- Date: Mon, 28 Jan 2002 13:46:32 -0700
On 1/28/02 1:02 PM, "Douglas Davidson" <email@hidden> wrote:
>
On Monday, January 28, 2002, at 10:21 AM, 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?
>
>
If you wish a dictionary to be a property list, or part of a property
>
list, then the keys must be strings.
Bingo! That's exactly what I was trying to do.
>
If you wish to have more precise control over the handling of keys, you
>
can use a CFDictionary, which has several sets of callbacks defining
>
different policies, and allows you to write your own if you wish.
Great tip. Thanks.
--
Some people say Windows users have an inferiority complex.
That's not true. It's not a complex.