Re: Don't Understand KVC Error Using Array Operators
Re: Don't Understand KVC Error Using Array Operators
- Subject: Re: Don't Understand KVC Error Using Array Operators
- From: Jon Gordon <email@hidden>
- Date: Tue, 8 Jul 2008 11:58:34 -0400
"D'oh!"
-H. Simpson
I made the change, and it works perfectly now. Thanks very much!
On Jul 8, 2008, at 11:44 AM, Ron Lue-Sang wrote:
On Jul 8, 2008, at 8:02 AM, Jon Gordon wrote:
I can't understand why I'm getting an exception when I try to use
the array operators.
[SNIPPAGE]
valueForKey and valueForKeyPath are two different KVC accessors.
You're using valueForKey and passing a dot-separated string. People
usually use dot-separated strings as keypaths and pass them to
valueForKeyPath.
<more info than you really need to know to fix this>
It's totally legal to pass dot-separated strings to value for key,
but the NSObject built in logic won't be able to find a property or
getter method with a sig like "email@hidden".
Mainly since that's not a valid obj-c ivar or method name.
</more info than you really need to know to fix this>
use valueForKeyPath instead of valueForKey.
_______________________________________________
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