title: Core Data and Runtime Key Value Coding
body: <p>I was under the impression that with key-value coding, I could set any undefined attribute on a NSManagedObject at runtime and no exception would be thrown, but it wouldbe a way to hold objects attached to the model that are not in the data model.</p>
  
  <p>For example, I have a Foo object that does not have a "bar" attribute.  I though that at runtime, I could set it like so:</p>
  
  <pre><code>Foo *foo = [NSEntityDescription insertNewObjectForEntityForName:@"Foo" inManagedObjectContext:ManagedObjectContext];
  [foo setValue:@"foobar" forUndefinedKey:@"bar"];
  </code></pre>
  
  <p>I would then expect the ManagedObjectContext to hold this value until I queried it later, but a save on the Managed Object Context would not store the bar value.</p>
  
  <p>The famous error keeps popping up when I run this code:</p>
  
  <pre><code>the entity Foo is not key value coding-compliant for the key "bar"
  </code></pre>
  
  <p>..so my question is: What am I not getting or doing wrong?</p>