Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey
Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey
- Subject: Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey
- From: Charilaos Skiadas <email@hidden>
- Date: Fri, 8 Jul 2005 18:26:37 -0500
On Jul 8, 2005, at 5:42 PM, Michael Hanna wrote:
<snip>
when I try to add a single DLPassage object to a given DLEntry:
if ([oEntriesTable selectedRow] == -1)
return;
NSMutableArray * passagesArray;
NSMutableArray * entriesArray = [self mutableArrayValueForKey:
@"entries"];
DLEntry *anEntry = [entriesArray objectAtIndex:[oEntriesTable
selectedRow]];
passagesArray = [self mutableArrayValueForKeyPath:
@"anEntry.passages"];
this results in an error:
2005-07-08 18:29:46.469 DreamLog[19937] [<DLController 0x363090>
valueForUndefinedKey:]: this class is not key value coding-
compliant for the key anEntry.
Of course this would give you an error, since anEntry is not a key in
your class. What you possibly want in place of:
passagesArray = [self mutableArrayValueForKeyPath:
@"anEntry.passages"];
is:
passagesArray = [anEntry mutableArrayValueForKeyPath: @"passages"];
Or some such. Point is, you should not be using anEntry in the keyPath.
looked into this by searching the archives but came up with nothing
on mutableArrayValueForKeyPath. Any ideas why this is happening?
I'm quite the newb on all things bindings.
In that case, you will want to start by reading on key-value coding
http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueCoding/index.html
and possibly key-value observing
http://developer.apple.com/documentation/Cocoa/Conceptual/
KeyValueObserving/index.html
After that, it should make more sense why you should not expect your
code as it was to work.
regards,
Michael
Haris
_______________________________________________
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