Search code examples
core-dataxcdatamodel

The inverse relationship for <...> does not reciprocate an inverse relationship


I have the table A with the following relationships:

Relationship Destination Inverse
input        B           state
output       B           state

And the table B with the following relationship:

Relationship Destination Inverse
state        A           input

And I get the warning:

The inverse relationship for state.input does not reciprocate an inverse relationship

Is there a right way how can I fix the warning?


Solution

  • You cannot have the same relationship name state for different relationships on the other side.

    Either rename the state relationships to inputState and outputState.

    Or add an additional entity that manages this relationship and keeps track of the relationship type with an input/output attribute.

    Although I would not recommend the last solution (too complicated), you might need it if the state relationship of B should be input/output agnostic.

    A (inOut) <----->> (as) State (b) <<--------> (state) B