June 2016
Intermediate to advanced
214 pages
5h 40m
English
Whether we’re using a standard Core Data stack or a UIManagedDocument, we need to know when changes come in from iCloud. Changes will always come in asynchronously, and our NSManagedObjectContext won’t know about them. It’s our responsibility to notify our NSManagedObjectContext of incoming changes. To do that, we need to listen for the change notification via the NSNotificationCenter.
| | let center = NotificationCenter.default |
| | center.addObserver(self, selector: #selector(mergePSCChanges(_:)), |
| | name: .NSPersistentStoreDidImportUbiquitousContentChanges, |
| | object: mainContext) |
Just like with the UIDocumentStateChangedNotification for the UIManagedDocument, it’s a ...
Read now
Unlock full access