4

I'm wondering how to share an entity between two different core data models?

For example, I have a "Universe" model which describes a "WorldData" with its "CountryData". And in another hand, I have a "Population" model which describes a "HumanData" with its "CountryData".

I definitely want to keep my models separated.

Thanks in advance.

VdesmedT
  • 9,037
  • 3
  • 34
  • 50
croustibapt
  • 253
  • 1
  • 8

1 Answers1

0

Have you checked the Core Data Guide? Managing relationships between entities is pretty basic.

If you want to manage a relationship between your Universe entities and your Population entities, you should describe them in the same model. Off the top of my head, I can't think of any benefits of putting two related entities in different Core Data Models.

kubi
  • 48,104
  • 19
  • 94
  • 118
  • I know, that's what I've done but now I'm asked to splited the two main functionalities (Universe and Population) so I can produce an independent library corresponding to only one model. That's ok if you consider only the library but I want to reuse this analysis for my own project which include the two models. I want to access to the entity of a model 2 in a model 1 without redefining it... – croustibapt Dec 23 '10 at 16:44
  • I found that : http://stackoverflow.com/questions/1554623/illegal-attempt-to-establish-a-relationship-xyz-between-objects-in-different-co – croustibapt Dec 24 '10 at 09:53