May a NSManagedObjectContext re-fault objects automatically?

Posted by frenetisch applaudierend on Stack Overflow See other posts from Stack Overflow or by frenetisch applaudierend
Published on 2010-05-23T18:57:57Z Indexed on 2010/05/23 19:00 UTC
Read the original article Hit count: 438

I am trying to create an application which allows background threads to update core data objects while the user might be reading the same data.

My approach to this would be to use multiple NSManagedObjectContexts and then before a background thread does a -save: operation, I fetch the object the user is currently working on and fire the fault for all its properties and relationships recursively. This way I have all objects the user could act with in my NSManagedObjectContext without seeing the already updated values.

But this can only work if the NSManagedObjectContext cannot decide himself that e.g. memory usage is too high, and starts faulting objects which I do not explicitly reference (other than through the NSManagedObject relationship).

So the question is, can the NSManagedObjectContext decide that an object needs to be re-faulted, without intervention from my side?

Thanks for your effort, Markus

© Stack Overflow or respective owner

Related posts about core-data

Related posts about nsmanagedobjectcontext