Hi all,
Sorry for the long question but I think it needs some background :S
I have the following model in CoreData:
A Guest can have any number of Scores in its scores relationship. A Score can have a maximum of two Guests in its guests relationship.
For each pair of Guest entities I model have a Score entity with a value indicating how well they get on with one-another.
In my interface, I want users to be able to select any Guest from a list, then view a second list of all the other Guests and the score that associates the each of those Guests with the originally selected Guest like so:
Fetching an array of all Guests for the first table (tv1) is simple enough. Currently for the second table I am fetching all the other Guests by filtering this array using the following predicate:
[NSPredicate predicateWithFormat:
[NSString stringWithFormat:@"not displayName == '%@'",
[[allGuests objectAtIndex:[tv1 selectedRow]] valueForKey:@"displayName"]]];
Which works OK but my problem is knowing how to display the correct Score.value. I feel that I should instead be using the relationship of the selected Guest.scores to populate the second tableview but I'm not sure how to do this. Any pointers would be welcome - thanks!