Ticket #507 (closed defect: fixed)
valueForKey(key) no longer working with NSManagedObject subclasses.
| Reported by: | johnmacshea@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | major | Milestone: | MacRuby 0.6 |
| Component: | MacRuby | Keywords: | valueForKey, KVC, Core Data |
| Cc: |
Description
In MacRuby 0.4 - any method in an NSManagedObject subclass (or in any other class) could be bound (eg via a controller) to a (view) nscontroller/field.
Now - in 0.5 beta 1 and 2 (unless a variable of the same name is a property in the Entity that the NSManagedObject represents) valueForUndefinedKey(key) is called in the subclass, if that method exists, or an error occurs (if valueForUndefinedKey(key) does not exist) - eg: [<Student 0x200391280> valueForUndefinedKey:]: the entity Student is not key value coding-compliant for the key "age".
This does not occur in a non NSManagedObject subclass - when view objects are bound to other classes' methods(attributes) - it all works fine.
The different version of NSManagedObject valueForKey could be the culprit vis a vis valueForKey in NSObject, but in any case - as mentioned - it worked fine in 0.4.
Example project attached.


