开发者

Sorting NSFetchedResultsController's sections array

Is there a way to sort the sections property of NSFetchedResultsController? Let's say i don't want m开发者_开发百科y 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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜