title: Why is my NSManagedObject not KVC compliant?
body: <p>I'm attempting to use KVC to retrieve the value of a property of a custom NSManagedObject entity built using Core data. I'm getting a UnknownKeyException when trying to access a property a few levels deep, and for the life of me i can't figure out why...</p>
  
  <p>The root entity is called "Catch". it has a number of properties: weight, length, etc. It also has a to-one relationship to another entity called "Species". Species has a name property defined as NSString.</p>
  
  <p>So:</p>
  
  <pre><code>//this will output the species name (i.e. "Brook Trout")
  NSLog(@"Catch.species.name = %@", catch.species.name);
  
  //this will throw a NSUnknownKeyException
  NSLog(@"Catch.species.name = %@", [catch valueForKey:@"species.name"]);
  
  //but this works...!?
  Species *species = (Species*)[catch valueForKey:@"species"];
  NSLog(@"Species.name = %@", species.name);
  </code></pre>
  
  <p>The specific exception details are:</p>
  
  <p><em>*</em> Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: the entity Catch is not key value coding-compliant for the key "species.name".'</p>
  
  <p>Does anyone who understands this stuff better than me know what is going on?</p>
  
  <p>Thanks in advance!</p>