简体   繁体   English

使用iCloud的核心数据永远不会从“使用本地存储:1”切换

[英]Core Data with iCloud is never switching from `Using local storage: 1`

I've got iCloud set up with Core Data, but it never seems to switch to use the ubiquitous storage from the local storage. 我已经使用Core Data设置了iCloud,但似乎从未切换到使用本地存储中无处不在的存储。 Looking at the iCloud panel in Xcode I can see the iCloud status is Idle, and I can even see that directories are being created inside my ubiquitous container ( NSPersistentStoreUbiquitousContentNameKey ), but there is never any activity (uploads or downloads) on the graph. 看看Xcode中的iCloud面板,我可以看到iCloud状态是空闲的,我甚至可以看到在我无处不在的容器( NSPersistentStoreUbiquitousContentNameKey )中创建了目录,但是图上没有任何活动(上传或下载)。

I'm only getting the following in the console: 我只在控制台中获得以下内容:

-[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](760): CoreData: Ubiquity:  me~3C82877D-69EE-5968-A69C-37FD71227462:MyApp
Using local storage: 1

I'm expecting it to eventually flip to not use local storage, but this never happens. 我期待它最终不会使用本地存储,但这种情况从未发生过。

Setting the ubiquity log level to 3, I can see the following logs in my console: 将ubiquity日志级别设置为3,我可以在控制台中看到以下日志:

__60-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:]_block_invoke(1289): CoreData: Ubiquity:  Coordinated read finished for ubiquity root url: file:///Users/me/Library/Mobile%20Documents/VK94X636H2~com~company~MyApp/
-[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:](1081): CoreData: Ubiquity:  Post store setup succeded. <NSSQLCore: 0x10040bc90> (URL: file:///Users/me/Library/Containers/com.company.MyApp/Data/Library/Application%20Support/CoreDataUbiquitySupport/me~3C82877D-69EE-5968-A69C-37FD71227462/MyApp/33D95E86-2331-4ED6-9ECF-FC88E130A38F/store/MyApp.storedata)
-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:](1298): CoreData: Ubiquity:  Read finished: 1
-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:](1301): CoreData: Ubiquity:  Read finished: 1 / 1 / file:///Users/me/Library/Mobile%20Documents/VK94X636H2~com~company~MyApp/CoreData/MyApp/
-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:](1305): CoreData: Ubiquity:  Blocking for initial sync: <PFUbiquitySetupAssistant: 0x10021edc0>

So it seems it's stuck on the Blocking for initial sync , but I'm not sure why. 所以它似乎停留在Blocking for initial sync ,但我不知道为什么。

Does anyone know what might be wrong? 有谁知道什么可能是错的?

Well, it turned out that simply restarting my Mac fixed this problem. 好吧,原来只是重新启动我的Mac修复了这个问题。

A little concerning given iCloud's reputation, but at least it is working! 有点关于iCloud的声誉,但至少它有效! It appears that even after the improvements to iCloud in iOS 7 and OS X 10.9 there's still some strange issues going on. 看来,即使在iOS 7和OS X 10.9中对iCloud进行了改进之后,仍然存在一些奇怪的问题。

I've got pretty much the same issue but on an iOS 7.0.6. 我有几乎相同的问题,但在iOS 7.0.6上。

Another strange, possibly related thing, is that in the iOS device when I go to: "Settings > iCloud > Documents & Data", My app seems to be listed there but the name is 'blank' (so the row is just an icon and a switch). 另一个奇怪的,可能相关的事情是,在我去的iOS设备中:“设置> iCloud>文档和数据”,我的应用程序似乎列在那里,但名称是“空白”(所以行只是一个图标和一个开关)。

Restarting the device does not help, neither does removing/adding the iCloud account. 重新启动设备无效,也无法删除/添加iCloud帐户。 And I can't find any other mention of Blocking for initial sync other than this page. 除了这个页面之外,我找不到任何其他提及Blocking for initial sync

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM