How to share an entity between two different core data models

吃可爱长大的小学妹 提交于 2019-12-21 17:47:04

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/4520300/how-to-share-an-entity-between-two-different-core-data-models

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!