Is there a way to sort the sections property of NSFetchedResultsController? Let's say i don't want my sections to be sorted alphabetically ascending, but descending. Or maybe not even alphabetically but ascending by the number of rows in a section.
I can imagine that sorting the array directly isn't a good idea, since NSFetchedResultsController created and filled it for me..
"1) use a transient property that joins the property to sort by and the property that will be displayed as the title and specified in the sectionNameKeyPath and
2) then use the UITableViewDelegate titleForHeaderSection to extract the name from the value."
more here: http://machine501.com/blog/2011/04/26/uitableview-section-sorting-a-hack/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With