Recursive entities

I have a Bracket entity that contains some number of Match entities, so that's a simple 1 to many relationship. On Match though, I now want to point to the next winner match and the next loser match, plus a couple other options (I have 4 "destination" matches). How do I do that and still handle the fact Core Data wants pointers to the source entity.

You do exactly what you'd do in any other case:

Create a new relationship on Match, and specify that the type is Match.


Naturally, you'll want to specify that the relationship is optional (since not every Match will have a "next winner match" or a "next loser match").


If tracking the inverse of the four different destination matches is inconvenient, don't specify an inverse for those relationships.

Recursive entities
 
 
Q