iCloud Core Data Not available after running in Xcode 6 / ios 8 SDK

回眸只為那壹抹淺笑 提交于 2020-01-11 19:58:21

问题


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

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

  • 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

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

I've also tried the following entitlements:

  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

回答1:


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.

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

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.



来源:https://stackoverflow.com/questions/25818825/icloud-core-data-not-available-after-running-in-xcode-6-ios-8-sdk

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!