简体   繁体   中英

CoreData crashing with fetched property in child managed object context

I have what I thought was pretty simple. There is a parent moc that is on a private queue, and a child moc that is on the main queue. The schema contains the following fetched property predicate in an entity:

    parentuuid == $FETCH_SOURCE.uuid

When I go to fetch this from within the entity's class (in the child moc on 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.'

I can tell basically what's going on here. For some reason CoreData has fetched an object id instead of an object, and it's trying to run the predicate on that. I don't know why that's occurring.

I've traced this to the parent/child managed object context. If I go back to just using one managed object context on the main thread, this crash stops.

Has anyone seen this before?

联系Apple,这在iOS的未来版本中已得到修复。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM