O'Reilly logo

Core Data in Swift by Marcus S. Zarra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sharing Data Between iOS and OS X

So far, we’ve discussed sharing data between iOS devices and linking our OS X application to iCloud. However, we haven’t discussed how to share data between OS X and iOS. Fortunately, there’s virtually no difference between OS X and iOS iCloud integration, though there are a couple of rules that we need to follow.

The Content Name Key Must Be the Same

The NSPersistentStoreUbiquitousContentNameKey is the unique value that iCloud uses to determine what data we’re accessing. If two devices use the same value and are signed by the same developer, they’ll be able to access the same data. If one or more devices and one or more OS X machines use the same key, they’ll share the same data. Throughout these examples, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required