I have an NSMutableArray which has about 18 objects. They are in a specific order that I want. I have to add these objects into an NSSet to be saved in Core Data.
But, once I pull them out of the NSSet using [myObject.items allObjects] it does not keep the original order that I added the objects as. How can I keep the order that I want, I don’t want to have to resort them.
If you don’t want to sort them you can add a property (e.g.
int indexInList) to the objects which stands for the position in the list.But sorting the list in respect to a property of the objects would be very easy too with