views:

208

answers:

1

I have a grouped table retrieved using CoreData. The sections are based on a Boolean field in the SQLLite dB. How can I reverse the order of the groups in the table display? The default is to list the false values first (obviously, as false == 0, true == 1).

I guess I could change the database. My field name = isMandatory, so I could change it to isNotMandatory and fix my problem, but it would still be nice to know how to reverse the sort order of groups.

+1  A: 

" retrieved using CoreData" is a rather broad description. If you are using a fetch request (NSFetchRequest), you can set the sortDescriptors for it. This array holds NSSortDescriptor instances, for which you can set the sort direction to be ascending or descending.

Johan Kool
Thanks. Added a second sortDescriptor and that took care of my problem
Alpinista