Re: Newbie Problem with KVC compliance
Re: Newbie Problem with KVC compliance
- Subject: Re: Newbie Problem with KVC compliance
- From: Matt Neuburg <email@hidden>
- Date: Thu, 26 Oct 2006 12:11:14 -0700
- Thread-topic: Newbie Problem with KVC compliance
On Thu, 26 Oct 2006 19:22:12 +0200, shaun bear <email@hidden> said:
>I am a newbie to Cocoa programming and am trying to make sense of
>CoreData and bindings. I have run in to a problem. I am trying to set
>a value for a sub-class of ManagedObject: Orders which is mapped to
>an Entity: Orders. I have created and instantiated a class:
>DownloadController, in interface builder, that responds to a a button
>click.
> I want to create an instance of the Orders class and the set value
>for an attribute: message. It compiles OK but when I run it and click
>the button I get the following message: "...<Orders 0x3a9270>
>setValue:forUndefinedKey:]: this class is not key value coding-
>compliant for the key message. "
Your first impulse should be to believe what you're being told. There is a
key @"message". You (Orders) are apparently not KVC-compliant for that. To
see what KVC-compliance entails, read this:
<http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Co
ncepts/Compliant.html>
Here, "key" is "message". So Orders must implement -message and -setMessage.
Your quoted code suggests that perhaps you have implemented the latter but
not the former? m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden