I have what I thought was pretty simple. There is a parent moc that is in the private queue, and a child moc that is in the main queue. The schema contains the following property predicate in essence:
parentuuid == $FETCH_SOURCE.uuid
When I go to get this from an entity class (in a child moc in the main thread), I get an exception:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<_NSObjectID_48_2 0x12fafb10> valueForUndefinedKey:]: this class is not key value coding-compliant for the key uuid.'
Basically I can tell what is going on here. For some reason, CoreData retrieves the object identifier instead of the object and tries to run a predicate on it. I do not know why this is happening.
I traced this to the context of the object managed by the parent / child. If I return to the simple use of one managed entity context in the main thread, this failure will stop.
Has anyone seen this before?
source share