Search code examples
iosmultithreadingcore-datansmanagedobjectcontext

Will MOC created as child of an other MOC include unsaved changes too?


I create temporaryContext like below. Will it include unsaved changes or only saved ones from Utility.managedObjectContext()?

let temporaryContext = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)
temporaryContext.parentContext = Utility.managedObjectContext()
temporaryContext.performBlockAndWait({

I haven't found anything about it in Core Data Programming Tutorial.


Solution

  • Short answer is NO.

    The child will only have items that were persisted before the child fetched them.

    This is different than before the child was created.