Hello experts,
I have troubles getting my NSTableView keep the contents of a to-many relationship ordered.
What I have is an entity "Relationship" in a to-many relationship with an entity "Card" both managed by an NSArrayController. Card has 2 attributes, "number" (int) and "name" (String) displayed via Bindings in two columns of a NSTableView. I can sort table columns permanently, but on every new insert of a card, the rows of the table view rearrange themselves randomly (however, deletion of a card keeps row order).
What I want is the following behaviour: The user can sort columns, but when he inserts a card, the card should be displayed as the very last row of the table (not sorted directly upon insert, but of course, not showing random rearranging, either). Only when the user sorts again, the new card will be sorted, too.
I know that the contents of a to-many relationships are kept as sets, but I do not know how to go on from there.
I appreciate any help.