在我的项目中,我将UIManagedDocument与CoreData和iCloud一起使用。在iCloud中创建UIManagedDocument时似乎有很多错误 - 特别是当没有网络服务时。在iCloud中创建UIManagedDocument时出现错误/崩溃
但现在我得到的网络服务(还带wifi)一些奇怪的错误/应用程序崩溃保存文档创造时:
-[PFUbiquitySetupAssistant validateOptionsWithError:](262): CoreData: Ubiquity: Error attempting to read ubiquity root url: file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/.
Error: Error Domain=LibrarianErrorDomain Code=1 "The operation couldn’t be completed. (LibrarianErrorDomain error 1 - Unable to initiate item download.)" UserInfo=0x1f56d140 {NSURL=file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/, NSUnderlyingError=0x1d89b4a0 "The operation couldn’t be completed. (UBErrorDomain error 0.)", NSDescription=Unable to initiate item download.}
userInfo: {
NSDescription = "Unable to initiate item download.";
NSURL = "file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/";
NSUnderlyingError = "Error Domain=UBErrorDomain Code=0 \"The operation couldn\U2019t be completed. (UBErrorDomain error 0.)\"";
}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
*** First throw call stack:
它说,从事务日志文件夹中下载操作不能完成。我无法理解这个应用程序应该创建一个文件,而不是下载任何东西。
btw应用程序的iCloud文件夹是空的!
从设备上删除iCloud帐户并再次登录也没有帮助。该设备是运行iOS 6的iPhone 4S。
任何人都有类似经历?
编辑:现在
,后缺失的一些hundrets和重建我得到的同一设备上的不同的错误:
-[PFUbiquitySafeSaveFile waitForFileToUpload:](268): CoreData: Ubiquity: <PFUbiquityPeerReceipt: ...>(0)
permanentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/receipt.0.cdt
safeLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.0.cdt
currentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.0.cdt
kv: (null)
Safe save failed for file, error: Error Domain=NSCocoaErrorDomain Code=512 "The file upload timed out." UserInfo=0x1de36dc0 {NSLocalizedDescription=The file upload timed out.}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
*** First throw call stack:
不知怎的,好像该装置具有iCloud服务无法访问即使它得到一个iCloud令牌和可达性很好...
很好,我很害怕得到这个答案的;)有了这个设备没有牺牲帮助 - 我删除了完整的iCloud帐户并重新添加它 - 没有成功。我会提交一个错误,但实际上这个错误是不可重现的(尤其是因为没有明显的原因,为什么设备无法访问iCloud)... – FrankZp 2013-03-16 09:51:44
还有一个问题:这些内部错误只与UIManagedDocument/Core Data& iCloud还是UIDocument&iCloud?因为那么离开UIManagedDocument并使用UIDocument设计另一个模式将是另一种选择。 – FrankZp 2013-03-16 14:33:05
我正在专门讨论Core Data内置于iCloud支持中的错误,因此它们不适用于Uidocument。但是,UIDocument有自己的问题需要处理。无论如何,我建议提交错误信息,包括错误信息,因为他们知道这样的问题,并且错误部分取决于有多少人为他们提交了问题。 – 2013-03-16 15:14:26