I have three managed object context, namely :
masterManagedObjectContext(NSPrivateQueueConcurrencyType),
backgroundMangedObjectContext(NSPrivateQueueConcurrencyType),
uiManagedObjectContext(NSMainQueueConcurrencyType)
Master is the parent, and other two are its children. When I save any child context, I do save master context. But when backgroundMangedObjectContext
saves in master, UIManagedObjectContext
did not get the updated data in executeFetchRequest
.
How do I achieve this? Please help. I am very much caught into this issue for past three days.
There were some posts suggest that, I must invalidate the previously fetched objects, when master gets saved. But I have no clue how to do it.
I tried
[UIManagedObjectContext reset]
But no luck.
Try this,
You need to add observer in viewDidLoad or init method,
and implement this method,
Wherever you call this method [context save:nil], it will call automatically and changes will update to masterContext.