Error messages in iOS CoreData + iCloud after deleting and redeploying app

本秂侑毒 提交于 2019-12-07 15:42:42

问题


The application has been put in iCloud since the beginning, so I have the opportunities to fill it with data, and see synchronization happening on other devices. However I am starting to have problems after deleting and redeploying the application on one device only.

In particular, at startup, it's taking a lot at this point:

NSLog(@"add coordinator");
if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error]) {
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    abort();
}
NSLog(@"finish");

I can see "add coordinator" in console, then it seems to be in pause forever. Instead by activating core data logging, I can see that is doing a lot of select and update.

Then an infinite list of log error messages for each transactionNumber is shown:

CoreData: Ubiquity: Error importing transaction log: <PFUbiquityTransactionLog: 0x1929e350>
    transactionLogLocation: <PFUbiquityLocation: 0x17bf1c40>: /private/var/mobile/Library/Mobile Documents/6G8M57K6MU~myapp/mobile.63606F7B-D6A9-5937-9160-126AC1315EBF/myAppCloud/3IEWV8FXM6GJ58H5PkyqFsyuoUZ2qIOuJOfon1QIYC4=/035A5A1C-F893-4B67-A784-866A4DE1B3F1.1.cdt
    transactionNumber: 1
, exception: -[__NSCFDictionary setObject:forKey:]: attempt to insert nil key
-[_PFUbiquityRecordsImporter operation:failedWithError:](839): CoreData: Ubiquity:  Import operation encountered an error: Error Domain=NSCocoaErrorDomain Code=134060 "The operation couldn’t be completed. (Cocoa error 134060.)" UserInfo=0x194c9f40 {exception=-[__NSCFDictionary setObject:forKey:]: attempt to insert nil key} while trying to import the log file at the URL: <PFUbiquityTransactionLog: 0x1929e350>
    transactionLogLocation: <PFUbiquityLocation: 0x17bf1c40>: /private/var/mobile/Library/Mobile Documents/6G8M57K6MU~myapp/mobile.63606F7B-D6A9-5937-9160-126AC1315EBF/myAppCloud/3IEWV8FXM6GJ58H5PkyqFsyuoUZ2qIOuJOfon1QIYC4=/035A5A1C-F893-4B67-A784-866A4DE1B3F1.1.cdt
    transactionNumber: 1

Then as I said, the "finish" is printed, and the app doesn't to have any data at all.


回答1:


An Apple engineer replied me to a post I did on Apple Dev forum, stating that this is a known bug that has been fixed on forthcoming iOS 6.

So, there's no solution than scratching all data on devices and start again. At this point, I suppose I will ship with CoreData without iCloud.



来源:https://stackoverflow.com/questions/11042558/error-messages-in-ios-coredata-icloud-after-deleting-and-redeploying-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!