如何在XCode中设置反比关系(How to set an inverse relationship in XCode)

系统教程 行业动态 更新时间:2024-06-14 16:59:46
如何在XCode中设置反比关系(How to set an inverse relationship in XCode)

这是一个愚蠢的问题,但我认真找不到答案......

我有一个从实体Events到Discounts的一对多关系,我在Xcode中设置了这样的关系:

我需要这种关系是相反的,所以我可以检查Discount来自哪个Event ,但在XCode中,我只能选择“不反向”。 我怎样才能将这种关系设定为逆向?

如果你必须以编程方式进行,首先,认真对待? 它不能从XCode完成? 其次,我该怎么做呢? 这应该在哪里完成?

谢谢

This is a silly question, but I seriously didn't find an answer...

I have a one-to-many relationship from the Entity Events to Discounts and I set a relationship like this in Xcode:

I need that relationship to be inverse, so I can check which Event a Discount is from, but in XCode I can only choose "No Inverse." How can I set that relationship to be inverse?!

If you have to do it programatically, first, seriously? It can't be done from XCode? Secondly, how can I do it? And where should this be done?

Thanks

最满意答案

为了能够设置反向关系,您需要先在目标实体中创建它。

因此,在折扣实体中创建您想要用作反向(例如event )的event ,那么您将能够选择它作为您的toDiscounts关系的反向

To be able to set inverse relationship you need to create it first in destination entity.

So in Discounts entity create relationship to Event that you want to use as reverse (e.g. event), then you will be able to choose it as reverse for your toDiscounts relationship

更多推荐

本文发布于:2023-04-17 08:52:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/920ea92dcf7e7e302fd6a10cae7ae1ee.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:反比   关系   如何在   XCode   relationship

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!