Basic data with iCloud. Sync issues. (MacOS vs iOS - conflicts)

I have some problems while working with CoreData and iCloud. I used an example from the Apple Developers Forum (iCloud), the IPhoneCoreDataRecipes project, which introduces CoreData through iCloud. It works fine, but there are conflicts, and not all entities are synchronized.

You can see the following warnings in the log:

Warning>: +[PFUbiquityRecordImportConflict createTransactionLogForTransactionEntry:withError:](607): CoreData: Ubiquity:  Unable to find transaction log for entry: <PFUbiquityTransactionEntry: 0x68b9a60> (entity: PFUbiquityTransactionEntry; id: 0x68c5d50 <x-coredata://697F667C-7541-43E7-B21B-5362D165537B/PFUbiquityTransactionEntry/p2> ; data: {
    actingPeer = "0x1526e0 <x-coredata://697F667C-7541-43E7-B21B-5362D165537B/PFUbiquityPeer/p1>";
    globalIDStr = "com.appmania.dreambookdata.coredata:DreamHistory:p1:mobile.99829CE6-D497-590F-B2F8-795CFFC84CCB";
    knowledgeVectorString = "mobile.99829CE6-D497-590F-B2F8-795CFFC84CCB:1";
    localIDStr = "x-coredata://D45E85ED-A2B7-48AC-96BF-6B2C64812656/DreamHistory/p1";
    storeMetadata = "0x12d4a0 <x-coredata://697F667C-7541-43E7-B21B-5362D165537B/PFUbiquityStoreMetadata/p1>";
    transactionDate = "2011-12-01 08:00:13 +0000";
    transactionLogFilename = "7C9AD5E3-457E-4E2B-8F1C-A7D8878E5BDB.1.cdt";
    transactionNumber = 1;
    transactionTypeNum = 0;
})

Does anyone know how to resolve such conflicts? Thank.

+5
source share
1 answer

It is recommended that you specify a merge policy in the context of the managed entity:

moc.mergePolicy = [[NSMergePolicy alloc] 
  initWithMergeType:NSMergeByPropertyObjectTrumpMergePolicyType];

There are also other merge policies , choose the one that suits your application.

+2

All Articles