I am new to CoreData and am struggling to work out the correct way to model a particular relationship. I have an entity called 'Friend' with a few attributes such as 'name', 'age', 'sex' etc.
I would like to be able to model a score between two instances of Friend and am having trouble getting my head around the best way to do this.
For example for 3 friends called A, B and C, there may be scores like so:
A <-> B: 3
A <-> C: 2
B <-> C: 4
or in matrix form:
A B C
A 0 3 2
B 3 0 4
C 2 4 0
The best I have come up with is to have a 'Score' entity with a 'value' integer attribute and two relationships to 'friendA' and 'friendB' - but if this is the correct approach how should I model the inverse relationships on the Friend entity?
Many thanks in advance for any help!