Open grahamburgsma opened 6 years ago
Just discovered the original Seam project (https://github.com/nofelmahmood/Seam) handles this in the didFinishSyncing
notification, seems like a good approach.
NSNotificationCenter.defaultCenter().addObserver(self, selector: "didFinishSyncing:",
name: SMStoreDidFinishSyncingNotification,
object: seamStore)
func didFinishSyncing(notification: NSNotification) {
// Merge Changes into your context after syncing completes
mainContext.mergeChangesFromStoreDidFinishSyncingNotification(notification)
}
I am trying to use Seam3 with an
NSFetchedResultsController
which uses the mainviewContext
(persistentContainer.viewContext
). Unfortunately, any changes made by Seam3 from a sync aren't notifying the FRC delegate. I believe this is because the changes from thelocalStoreMOC
aren't merged to the mainviewContext
as they should.I tried finding the bug myself but I just started using CoreData a few weeks ago and am no expert, nothing I've tried has worked. If anyone could assist that would be great.
I understand I could use the
SMStoreDidFinishSyncOperationNotification
to update my UI instead of usingNSFetchedResultsController
, but using FRC is definitely the more efficient and preferred approach so I think this is a bug.Would be happy to fix it myself if anyone can point me in the right direction. Thank you!