5

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
lewis
  • 2,936
  • 2
  • 37
  • 72
  • any updates/solution received from Apple Support? I have the same problem – Allen Wang Oct 28 '14 at 00:23
  • Apple have said that running the ad hoc build with a new model will not work, but a signed/app store version will work. Terrifying! Will report back either way. – lewis Oct 28 '14 at 03:17
  • really? how can we test it? The problem seems still exists for my test flight beta version. Please keep me posted what you see. thx. – Allen Wang Oct 28 '14 at 03:40
  • if i were you I would raise your own ticket with apple, you can't mess around with this stuff and no one can have the knowledge they do. you get 2 tickets with your app store membership. you will probably have an answer from them before you do form me – lewis Oct 28 '14 at 08:29

1 Answers1

3

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.

Iain McManus
  • 1,095
  • 13
  • 21
  • Thanks for this Iain. Unfortunately it doesn't work :( I've updated the question – lewis Sep 15 '14 at 21:07
  • If you're seeing "Using local storage: 1" then that is promising. That means it is at least connecting to iCloud. Is it ever changing to "Using local storage: 0" ? Is this on a device or the simulator? – Iain McManus Sep 16 '14 at 00:08
  • It's on the device. It shows Using local storage: 1 on both runs, but the data isn't available on the second run. – lewis Sep 16 '14 at 09:32
  • If it's never changing to "Using local storage: 0" then that means it is stuck on only the temporary store. If you run the app on your device via Xcode does it show any iCloud activity? Is the initial amount of data to synchronise very large? – Iain McManus Sep 17 '14 at 03:19
  • 4
    Hi @Iain thanks for your time and expertise. I've raised this with Apple Developer Technical Support as after your help and a few others I'm not convinced that it's me making a mistake any more. Thanks again. I'll post the answer when I get it. – lewis Sep 20 '14 at 20:57