ios4 - iphone SDK: Core Data, how to sort sections in an NSFetchedResultsController? -
i have core data app using sectionnamekeypath "group.name" fetchrequest in order group results group entity's name attribute. i'm grouping group.name i'd sort sections other group.name. according nsfetchedresultscontroller docs:
if controller generates sections, first sort descriptor in array used group objects sections; key must either same sectionnamekeypath or relative ordering using key must match using sectionnamekeypath.
which means sections must sorted in same order grouped in. despite documentation, prior ios 4.2 away without specifying sectionnamekeypath first sort descriptor allowed sort sections, no longer.
what best way sort sections in nsfetechedresultscontroller? example, want sections grouped "group.name" sorted "group.timestamp".
from nsfetchedresultscontroller docs:
you create subclass of class if want customize creation of sections , index titles. override sectionindextitleforsectionname: if want section index title other capitalized first letter of section name. override sectionindextitles if want index titles other array created calling sectionindextitleforsectionname: on known sections.
Comments
Post a Comment