xcode 核心数据中的关系同步

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6304042/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:14:15  来源:igfitidea点击:

Relationship Sync in Core Data

objective-cxcodecore-data

提问by user4951

If we select a core data and I click some relationship. Then I go to Data Model Inspector.

如果我们选择一个核心数据和我点击一些关系。然后我去数据模型检查器。

There is a section called Relationship sync. I wonder what it is? I thought core data are syncing relationship by default.

有一个部分称为关系同步。我想知道它是什么?我认为核心数据默认是同步关系。

For example, if I do employee.boss = someBoss, then automatically someBoss will add employee to his Employees relationship and oldBoss will remove employee from his/her employees relationship.'

例如,如果我执行employee.boss = someBoss,那么someBoss 会自动将雇员添加到他的雇员关系中,而oldBoss 将从他/她的雇员关系中删除雇员。

So how come?

那怎么来的?

The default value for the Synchronization item in Relationship sync is disabled by the way. So the normal synchronization can't be that. Is this about synchronization with server?

顺便说一下,关系同步中同步项的默认值是禁用的。所以正常的同步不可能是这样。这是关于与服务器同步吗?

I also see attribute sync and entity sync if I select attribute and entity respectively. What the hell is that?

如果我分别选择属性和实体,我也会看到属性同步和实体同步。这他妈到底是什么?

回答by TechZen

Sync in this instance means utilizing synchronization services between different instances of the app running on different devices. It doesn't have anything to do with Core Data per se but just notifies the synchronization services that Core Data is exposing that part of the data model to the synchronization services.

在这种情况下,同步意味着在不同设备上运行的应用程序的不同实例之间使用同步服务。它与 Core Data 本身没有任何关系,只是通知同步服务 Core Data 将数据模型的那部分暴露给同步服务。

If you are not using synchronization services, you can just ignore the setting.

如果您不使用同步服务,则可以忽略该设置。