如何在两个不同的核心数据模型之间共享实体
我想知道如何在两个不同的核心数据模型之间共享实体?
例如,我有一个“Universe”模型,它描述了“WorldData”及其“CountryData”。另一方面,我有一个“人口”模型,它描述了“HumanData”及其“CountryData”。
我绝对希望将我的模型分开。
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您检查过 核心数据指南?管理实体之间的关系是非常基本的。
如果您想要管理 Universe 实体和 Population 实体之间的关系,您应该在同一模型中描述它们。在我的脑海中,我想不出将两个相关实体放在不同的核心数据模型中有什么好处。
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.