3

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:

enter image description here

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

4

1 回答 1

8

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

因此,在 Discounts 实体中创建与要用作反向的事件的关系(例如event),然后您将能够选择它作为您的 toDiscounts 关系的反向

于 2013-03-27T10:59:45.327 回答