本文介绍了iCloud Core Data在Xcode 6 / ios 8 SDK中运行后不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Core Data与iCloud同步的应用程式。它在iOS 7中工作得很好。

I have an app that uses Core Data with iCloud sync. It works great in iOS 7.

我在运行XCode 6时遇到了一些麻烦,甚至在iOS 7设备上。这是我的测试:

I'm having some trouble since running it in XCode 6 though, even on an iOS 7 device. Here's my test:


  • 在iOS 7设备上:从应用商店下载当前的实时应用

  • 来自iCloud的数据

  • 构建并运行新版本的应用程序

  • 持续存储更改,原始数据不再可用

  • on iOS 7 device: Download current live app from app store
  • Sync data from iCloud
  • Build and run new version of app
  • Persistent Stores change, original data no longer available

这里是我的配置文件和xcode设置的屏幕截图:

Here's screen shots of my provisioning profile and xcode setup:

我也尝试过以下权利:


  1. 只需 com.apple.developer.icloud-container-identifiers

  2. com.apple.developer.ubiquity-container-identifiers 这是我以前的。当我运行测试时,这个位置的数据是第一次,但不是第二次运行。没有关于商店更改的事件,但它表示在第一次和第二次运行时使用本地存储:1

  3. 上述两个。获得与#2相同的结果

  1. Just com.apple.developer.icloud-container-identifiers
  2. com.apple.developer.ubiquity-container-identifiers this is what I had before. When I run the test with this in place the data is there first time but not on second run. There's no events about the store changing, but it says Using local storage: 1 on first and second run
  3. Both of the above. Get the same results as #2


推荐答案

看起来像是基于权利的屏幕截图您具有旧(无处不在容器)和新(iCloud容器)相关的权利。

It looks like based on the screenshot of the entitlements that you have both the old (ubiquity container) and new (iCloud container) related entitlements. I found, and have seen reported, issues when both old and new entitlements are present.

对于我的应用程序,我只保留旧的权利,并删除了两个新的XCode 6将尝试添加以修复它认为与iCloud存在的问题。我移除的两个键为:

For my app I kept only the old entitlements and deleted the two new ones that XCode 6 will attempt to add to fix issues that it believes are present with iCloud. The two keys I removed were:


  • com.apple.developer.icloud-container-identifiers

  • com.apple.developer.icloud-services

我只保留原键(com.apple.developer.ubiquity-container-标识符),并没有改变它的价值。有了这个应用程序仍然可以在iOS 7中使用XCode 6 GM构建时,可以像以前一样访问所有的数据。在iOS 8它也将工作,但似乎需要用户已更新他们的帐户到iCloud Drive。

I kept only the original key (com.apple.developer.ubiquity-container-identifiers) and did not change it's value. With that the app still works in iOS 7 when built using XCode 6 GM and can access all of the data as before. In iOS 8 it will also work however it seems to require the user to have updated their account to iCloud Drive.

这篇关于iCloud Core Data在Xcode 6 / ios 8 SDK中运行后不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 08:26