objective c - How do I model relative scores between entities in CoreData -


i new coredata , struggling work out correct way model particular relationship. have entity called 'friend' few attributes such 'name', 'age', 'sex' etc.

i able model score between 2 instances of friend , having trouble getting head around best way this.

for example 3 friends called a, b , c, there may scores so:

a <-> b: 3 <-> c: 2 b <-> c: 4 

or in matrix form:

  b c 0 3 2 b 3 0 4 c 2 4 0 

the best have come have 'score' entity 'value' integer attribute , 2 relationships 'frienda' , 'friendb' - if correct approach how should model inverse relationships on friend entity?

many in advance help!

your idea of score entity best can think of without more detail entire design. inverse relationship simple enough.

create many-to-many relationship between friend , score.

on score side set min , max count 2.

set friend side no min , no max.

this assuming order of friends in relation score not important.


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -