3

I'm facing a design problem using core data in an iOS app.
I've got two stores, one will contain a sort of catalog, the other only user data. I've read all those questions:

But what I still didn't get is if it is better two use one model on two persistent stores or two models merge them at runtime with two stores. What will be easier, eventually, to migrate?

Community
  • 1
  • 1
Andrea
  • 26,120
  • 10
  • 85
  • 131

1 Answers1

2

The definite way to go here is have one data model with two stores, administered via two so-called configurations.

In the model editor you can define which entities belong to which configuration.

In code you specify the identifier string of each configuration when adding the persistent store.

See the WWDC 2012 video on Core Data and iCloud that explains it really well.

Martin R
  • 529,903
  • 94
  • 1,240
  • 1,382
Mundi
  • 79,884
  • 17
  • 117
  • 140