该应用程序从一开始就放在 iCloud 中,因此我有机会向其中填充数据,并看到其他设备上发生的同步。
但是,仅在一台设备上删除并重新部署应用程序后,我开始遇到问题。
特别是在启动时,此时需要花费很多时间:
NSLog(@"add coordinator");
if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error]) {
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
NSLog(@"finish");
我可以在控制台中看到“添加协调员”,然后它似乎永远处于暂停状态。相反,通过激活核心数据记录,我可以看到正在执行大量选择和更新。
然后显示每个 transactionNumber 的日志错误消息的无限列表:
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
然后正如我所说,打印“完成”,并且应用程序根本没有任何数据。
一位 Apple 工程师回复了我在 Apple Dev 论坛上发布的帖子,指出这是一个已知错误,已在即将发布的 iOS 6 上修复。
因此,除了清除设备上的所有数据并重新开始之外,没有其他解决方案。
此时,我想我将使用 CoreData,而不使用 iCloud。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)