I have decided to abandon using ordered sets. They are not very flexible and you will run into issues like the one you have all the time. (One problem is that they are neither derived from NSArray
nor NSSet
so some standard manipulations become very difficult.)
I suggest to introduce a position
attribute to your entity or entities that need to be in a particular order. You can store this the moment the data comes in. The rest is trivial.