Icloud 在两个不同的设备上保存相同的UIManagedDocument会产生错误
是否应在我的两台设备上打开相同的Icloud 在两个不同的设备上保存相同的UIManagedDocument会产生错误,icloud,uimanageddocument,Icloud,Uimanageddocument,是否应在我的两台设备上打开相同的UIManagedDocument,然后保存(使用以下代码): 我被告知,UIManagedDocuments documentState已更改为UIDocumentStateSavingError,然后我收到以下错误: CoreData: error: (1) I/O error for database at /var/mobile/Applications/some-long-id/Documents/Read.dox/StoreContent.nosync
UIManagedDocument
,然后保存(使用以下代码):
我被告知,UIManagedDocument
s documentState已更改为UIDocumentStateSavingError
,然后我收到以下错误:
CoreData: error: (1) I/O error for database at /var/mobile/Applications/some-long-id/Documents/Read.dox/StoreContent.nosync/persistentStore. SQLite error code:1, 'cannot rollback - no transaction is active'
2013-05-14 16:30:09.062 myApp[11711:4d23] -[_PFUbiquityRecordImportOperation main](312): CoreData: Ubiquity: Threw trying to get the knowledge vector from the store: <NSSQLCore: 0x1e9e2680> (URL: file://localhost/var/mobile/Applications/some-long-id/Documents/Read.dox/StoreContent.nosync/persistentStore)
CoreData:错误:(1)位于/var/mobile/Applications/some long id/Documents/Read.dox/StoreContent.nosync/persistentStore的数据库的I/O错误。SQLite错误代码:1,“无法回滚-没有活动的事务”
2013-05-14 16:30:09.062我的应用程序[11711:4d23]-[u pfubiquityrecordomportoperation main](312):CoreData:Ubiquity:throw试图从商店获取知识向量:(URL:file://localhost/var/mobile/Applications/some-long-id/Documents/Read.dox/StoreContent.nosync/persistentStore)
有人知道为什么会发生这种错误吗?有几件事
我认为在两个不同的设备上保存同一个文档是一种误导,因为它实际上会在每个设备上处理您的数据库的本地副本-只有事务日志才会上载到iCloud
其次,我可能会感到困惑,但我在上面的代码片段中没有看到任何指示您正在执行保存的内容(除非它是由其中一个调用触发的,或者发生自动保存)
该代码段似乎正在做的是:
- 在数据库文档的子MOC线程上,运行以下块 密码
- 这段代码是纯UI相关的东西, 与数据库无关?唯一可能 要去DB的是cellForRowAtIndexPath——这通常是 只能执行读取操作,而不是其他操作 这需要节约
CoreData: error: (1) I/O error for database at /var/mobile/Applications/some-long-id/Documents/Read.dox/StoreContent.nosync/persistentStore. SQLite error code:1, 'cannot rollback - no transaction is active'
2013-05-14 16:30:09.062 myApp[11711:4d23] -[_PFUbiquityRecordImportOperation main](312): CoreData: Ubiquity: Threw trying to get the knowledge vector from the store: <NSSQLCore: 0x1e9e2680> (URL: file://localhost/var/mobile/Applications/some-long-id/Documents/Read.dox/StoreContent.nosync/persistentStore)