I'm experiencing some wired behavior with core data and iCloud sync. I added the iCloud documents and Cloudkit capabilities to my app and I subscribed to these three notifications:
NSPersistentStoreCoordinatorStoresWillChangeNotification
NSPersistentStoreCoordinatorStoresDidChangeNotification
NSPersistentStoreDidImportUbiquitousContentChangesNotification
The first time I ran the app I received these notifications:
Using local storage: 1
store will Change notification
store did Change notification
Using local storage: 0
but, NSPersistentStoreDidImportUbiquitousContentChangesNotification didn't get fired because core data did not download data from the ubiquitous container of my iCloud account.
However, when I exited the app and relaunched it even with airplane mode turned on, all my data got loaded immediately. It seemed that the data were downloaded and saved to SQLite store on the first launch but the notification wasn't fired so that my UI can be refreshed.
Have anyone experienced such before and what did you do in that situation.