Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在iCloud中创建UIManagedDocument时出错/崩溃_Iphone_Ios_Core Data_Icloud_Uimanageddocument - Fatal编程技术网

Iphone 在iCloud中创建UIManagedDocument时出错/崩溃

Iphone 在iCloud中创建UIManagedDocument时出错/崩溃,iphone,ios,core-data,icloud,uimanageddocument,Iphone,Ios,Core Data,Icloud,Uimanageddocument,在我的项目中,我将UIManagedDocument与CoreData和iCloud一起使用。在iCloud中创建UIManagedDocument时,似乎有很多bug,尤其是在没有网络服务的情况下 但现在我在保存文档以进行创建时,遇到了一些奇怪的错误/网络服务(也包括wifi)的应用程序崩溃: -[PFUbiquitySetupAssistant validateOptionsWithError:](262): CoreData: Ubiquity: Error attempting to

在我的项目中,我将UIManagedDocument与CoreData和iCloud一起使用。在iCloud中创建UIManagedDocument时,似乎有很多bug,尤其是在没有网络服务的情况下

但现在我在保存文档以进行创建时,遇到了一些奇怪的错误/网络服务(也包括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:
它表示无法完成事务日志文件夹中的下载操作。我无法理解这一点,因为应用程序应该创建一个文档,而不是下载任何东西

顺便说一句,应用程序的iCloud文件夹是空的

从设备中删除iCloud帐户并再次登录也没有帮助。该设备是运行iOS 6的iPhone 4S

有人有过类似的经历吗

编辑:

现在,经过数百次删除和重建后,我在同一台设备上发现了一个不同的错误:

-[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:
-[PFUbiquitySafeSaveFile waitForFileToUpload:(268):核心数据:普遍性:(0)
永久位置::/private/var/mobile/Library/mobile Documents/xxxxxxxxx~com~companyname~AppName/transactionfolder/mobile.XXXXXX-xxxxx-XXXX-xxxxx-xxxxxxxxxxxxxxx/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/receipt.0.cdt
安全位置::/private/var/mobile/Library/mobile Documents/xxxxxxxxx~com~companyname~AppName/transactionfolder/mobile.XXXXXX-XXXX-XXXX-xxxxxxxxxxxxxxxx-XXXXXXXXXXXX/Document/Q0_aoyzv8mtbaihmdwbiefhfhxmcgzit9rylthgqp4=/mobile.XXXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.0.cdt
当前位置::/private/var/mobile/Library/mobile Documents/xxxxxxxxx~com~companyname~AppName/transactionfolder/mobile.XXXXXX-XXXX-XXXX-xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxx/Document/Q0_aoyzv8mtbaihmdwbiefhxmcgzit9rylthgqp4=/mobile.XXXXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.0.cdt
千伏:(空)
文件的安全保存失败,错误:error Domain=nscocaerordomain Code=512“文件上载超时”。UserInfo=0x1de36dc0{NSLocalizedDescription=文件上载超时。}
***由于未捕获异常“NSInternalInconsistencyException”,正在终止应用程序,原因是:“此NSPersistentStoreCoordinator没有持久存储。它无法执行保存操作。'
***第一次抛出调用堆栈:
不知何故,该设备似乎无法访问iCloud服务,即使它获得了iCloud令牌,并且可访问性很好……

是的,我有过非常相似的体验。这些是核心数据iCloud集成中的内部缺陷。它们并不意味着你做错了什么,你也无法在代码中修复它们。你是对的——你没有下载代码中的任何内容,但是核心数据试图在幕后下载,但失败了。这完全超出你的控制

第一个错误是框架无法下载现有的事务文件。可能没有,但它甚至不知道。第二个错误表示无法创建任何新的事务文件。你是对的——你没有访问iCloud的权限,尽管API说你有


通过在设置-->iCloud中查找应用程序并删除其中的任何数据,从设备中删除应用程序,牺牲一只鸡,然后重试,您可能可以让事情再次正常运行。但问题又回来了。苹果的文件错误,希望得到修复。

如果您的设备在重置其iCloud数据后拒绝同步,请尝试通过设置重置所有设置。
常规重置所有设置。此方法不会删除任何应用程序数据,并且可以解决“尝试读取ubiquity根url时出错”的错误消息。

我知道这是一个老问题,但我一直在寻找类似的问题,以下内容可能会帮助其他人:

在我的例子中,我是在删除iCould数据和正在开发并从头开始重建的应用程序后得到这个结果的。完全关闭并重新启动设备似乎可以解决这个问题——不知道为什么,也许Timbo的“重置所有设置”也可以解决这个问题——但这样你就不会丢失其他应用程序设置


阿里

嗯,我害怕得到这个答案;)使用此设备没有任何帮助-我删除了完整的iCloud帐户并再次添加了它-但没有成功。我将提交一个bug,但实际上此错误是不可复制的(特别是因为没有明显的原因说明设备无法访问iCloud)……还有一个问题:这些内部bug是否仅与UIManagedDocument/Core Data&iCloud相关,还是与UIDocument&iCloud相关?因为离开UIManagedDocument,用UIDocument设计另一种模式是另一种选择。我专门讨论的是核心数据内置iCloud支持的bug,因此它们不适用于UIDocument。然而,UIDocument有自己的一系列问题需要处理。我建议不管怎样都要提交bug,包括你的错误消息,因为他们知道这样的问题,bug的优先级部分取决于有多少人为他们提交了问题。好吧,我还是要提交它们(在developer.apple.com/bugreporter/right?)。但是使用iCloud有可靠的解决方案吗?