Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

enter image description here

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
like image 391
lewis Avatar asked Oct 21 '22 01:10

lewis


1 Answers

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.

like image 187
Iain McManus Avatar answered Nov 01 '22 18:11

Iain McManus