• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey
      • From: Michael Hanna <email@hidden>
References: 
 >mutableArrayValueForKeyPath gives me valueForUndefinedKey (From: Michael Hanna <email@hidden>)

  • Prev by Date: Entities bound through third entity. Best practice?
  • Next by Date: Script Editor not displaying Suite info of loadable plugins
  • Previous by thread: mutableArrayValueForKeyPath gives me valueForUndefinedKey
  • Next by thread: Re: mutableArrayValueForKeyPath gives me valueForUndefinedKey
  • Index(es):
    • Date
    • Thread