I'm writing an app that syncs CoreData between OS X and iOS using iCloud. The issue I'm having is that both iOS and OS X apps are correctly writing data into the cloud, but they are not synced between each other. To be precise:
- I'm currently using a
BSCoreDataController
(https://github.com/adib/BSCoreDataController) which should be usable just fine (see the blog post link in the readme). - The store options used are:
[options setObject:@(YES) forKey:NSMigratePersistentStoresAutomaticallyOption]; [options setObject:@(YES) forKey:NSInferMappingModelAutomaticallyOption]; [options setObject:@"UctoXAccount" forKey:NSPersistentStoreUbiquitousContentNameKey];
- While the app is technically document-based, I'm not using any
NSDocument
orUIDocument
subclasses - all is in-house written. The document is pretty much just a file wrapper package in user-selected place (e.g. iCloud) with the CoreData stuff, I do not support auto-save, or anything similar at this moment. - When I create a document on the iPhone, it gets synced to OS X, but when opened on OS X (yes, I've waited until all data synced over), the managed object context doesn't contain any objects created on iOS.
- After creating some content on OS X with the same account, the entities are saved correctly, but again, not synced with the iOS content. I am attaching a screenshot of the file package's internal structure.
Is there something I'm missing that I need to do to make both sides sync between themselves? Do I need to manually add all persistent stores from within the file package?
Thanks in advance for any help on this subject, this has been troubling me for a long long time now...