Re: NSDictionary setValue KVO
Re: NSDictionary setValue KVO
- Subject: Re: NSDictionary setValue KVO
- From: Ken Thomases <email@hidden>
- Date: Sun, 10 Oct 2010 16:23:34 -0500
On Oct 10, 2010, at 4:00 PM, Quincey Morris wrote:
> On Oct 10, 2010, at 12:57, Ken Thomases wrote:
>
>> and b) what the heck "myDict.@allValues" is supposed to mean. I'm not aware of that being a valid KVC collection operator.
>
> From the discussion of -[NSDictionary valueForKey:] in the class reference:
>
>> If key does not start with “@”, invokes objectForKey:. If key does start with “@”, strips the “@” and invokes [super valueForKey:]with the rest of the key.
OK, thanks for pointing that out. I wasn't aware of that. (May have known it once, but forgot it thoroughly if so.)
However, that would seem to make it even less likely that it would be possible to key-value-observe such a keypath. There's no override of -addObserver:forKeyPath:options:context: documented, which would seem to be required to support observing such '@'-prefixed keys. Nor is there any discussion of it in the class overview.
Regards,
Ken
_______________________________________________
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