I have a problem sorting “join” entities with CoreData.
I’ve made a model like this:

The logic is like this: Entity A has a list of items. User can selects one or more items from A and put them in entity C. That works fine. But the results set becomes unsorted (logically). So I’ve implemented a “join” entity B like this:

So now the results can be sorted by the field date in entity B which is kind a “join” between entity A and B.
But here I get confused. When I insert new items into B, do I need to add them also to the C and A or they are inserted automatically with relations?
EDIT – solution:

When you call one of the CoreData-generated
addXXXItemsObjectmethods, or set a relation property likeb.c = myCInstance;, that will set up exactly one relation for you.So you can set up your B object in a number of different ways. First set up the
c <--> brelation:And then the
b <--> arelation:The simplest is probably just to use the first version for each:
Also, looking at your screenshot, it looks like you need to make some ends of your relationships as to-many.
EDIT: edited this about 5 times to make it more coherant.