Re: Storing values in dictionary with their address as the key
Re: Storing values in dictionary with their address as the key
- Subject: Re: Storing values in dictionary with their address as the key
- From: Charles Steinman <email@hidden>
- Date: Mon, 28 Jul 2008 15:09:20 -0700 (PDT)
--- On Mon, 7/28/08, Carter R. Harrison <email@hidden> wrote:
> Actually now that I'm looking at this more closely,
> NSDictionary is
> expecting an NSString for the key when inserting a value.
> Your
> example uses an NSValue for the key - the compiler is
> throwing a
> warning for this one..
That's because setValue:forKey: is a KVC method. The NSDictionary method, which accepts any object (though it may prefer strings -- I don't know), is setObject:forKey.
Cheers,
Chuck
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden