OS X and iOS App Integration with Core Data and iCloud

Taking our Core Data and iCloud integration one step further we now demonstrate how an OS X app can be synchronised with an IOS app using Core Data and iCloud integration.

The video below shows the integration that can be achieved between OS X and iOS apps.  Note that the iOS apps are the exact same apps shown in the other Core Data and iCloud Integration videos.

If there is enough interest I will post some of the OS X code, which uses NSPersistentDocument, used to share documents in iCloud, remove them from iCloud and to save local backup copies of iCloud documents.

6 thoughts on “OS X and iOS App Integration with Core Data and iCloud

  1. Hi! How did you managed to use NSPersistentDocument with iCloud, while official documentation clearly states the opposite (no support at all)? Would you please share the sources (OS X version) or at least give some conceptual guiding? Thank you!

    • As the documentation says there is no iCloud support so you have to build your own. Given NSPersistentDocument is just a plain sqlite file (binary, xml or sqlite), this is not hard to do. Primarily it involves overriding this method - (BOOL)configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:
      and passing NSPersistentStoreUbiquityNameKey as a parameter if the store is iCloud enabled. However you still need to migrate files to and from iCloud using the usual migratePersistentStore methods. I’ll see if I can find some time to post an explanation and some of the code in the next few days.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s