I have a Mac OS application that uses core data to persist its objects to disk, backed by sqlite.
I have a tableView where all the NSManagedObject subclasses can be inspected. This is bound to an arrayController that is bound to an entity in a managedObjectContext.
Using the objects from this arrayController, I load another arrayController that backs another tableView which is used to organise the objects in preparation for export to a tsv file. This tableView allows dragging and dropping to re-order, and removal of entries - but none of this impacts the managedObjectContext.
What is the best way to persist the contents of this second arrayController to disk so that when the document is reopened the tableView has the same objects in the same order as before?
All I have managed to concoct so far is to add an attribute to the managedObjects called secondaryArrayOrder, which is set on closing the document, or set to nil if an object is removed from the secondary arrayController. Whilst this will work, it seems like the wrong way to approach it.
EDIT - Added MacRuby tag as I've now answered my own question using that language.