I have an application with basic data and icloud to allow the user to use the same database on multiple devices. Synchronization works most of the time, but sometimes it does not work, i.e. Some transactions are simply skipped.
When I check the console, I get an error:
__ 45- [PFUbiquityFilePresenter processPendingURLs] _block_invoke (439): CoreData: Ubiquity: The librarian returned a serious error to start the download. Error Domain = BRCloudDocsErrorDomain Code = 5 "Operation could not be completed (error BRCloudDocsErrorDomain 5 - no document by URL)"
It's funny that this message appears even during synchronization.
The code is suitable for the latest version of Apple's "iCloud Programming Guide for Basic Data." The url store is encoded as follows:
NSURL *documentsDirectory = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
NSURL *storeURL = [documentsDirectory URLByAppendingPathComponent:@"iCloudSample.sqlite"];
Code for parameters:
storeOptions = @{NSPersistentStoreUbiquitousContentNameKey: @"iCloudSampleStore" ,
NSPersistentStoreUbiquitousContentURLKey: @"iCloudSampleURL"};
Code for the store:
NSPersistentStore *store = [_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
configuration:nil
URL:storeURL
options:storeOptions
error:&error];
Merge Policy (MOC is located on the main qeue)
_managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
[_managedObjectContext setPersistentStoreCoordinator:coordinator];
_managedObjectContext.mergePolicy = [[NSMergePolicy alloc]
initWithMergeType:NSMergeByPropertyObjectTrumpMergePolicyType];
As I understand the documents, there is not much to do (?). But I think I'm missing something, does anyone have an idea what to check, change, try? Anyone who had the same problem? Any ideas are welcome!