Search code examples
ioscore-dataios7icloudosx-mavericks

iOS7 / Mavericks apps icloud coredata slow first sync


I have released in appstore an app with iOS7 version and Mavericks OSX version. iCloud + coredata.

  • The objects I add with the iOS version takes 3 or 4 seconds to be visible in Mavericks version.

  • The objects I add with the Mavericks version takes various minutes to be replicated to iOS version (without entering in background, I force the iOS app to be in foreground).

NSPersistentStoreDidImportUbiquitousContentChangesNotification takes some minutes before first invocation in iOS. Why? Is someone experimenting the same trouble? Thanks


Solution

  • Most likely this is because iOS and Mac OS X handle iCloud updates differently.

    • Mac OS X is "greedy". As soon as an iCloud update exists, Mac OS X starts downloading it. Even if the app isn't running. Even if the app isn't installed on the Mac. Even if the app doesn't run on Macs. (Macs download iCloud data for iOS-only apps).
    • iOS doesn't download anything from iCloud until it receives a request from an app.

    This means that the Mac app gets a head start. When the Mac app asks for the data, there's a good chance it's already there. And if it's not all there, it's probably already downloading. But on iOS the process doesn't even start until you request it.

    There might be other factors at play, but Mac OS X is always going to get a head start over iOS for iCloud updates.