3

I'm quite new to CoreData and need help with one issue. I have tableview which simply lists cities stored in SQLite db. City is defined by "cityId" and "name" attributes.

Data are fetched using NSFetchedResultsController and everything works fine except that I can't figure out how to make FetchedResultsController to group cities by first letter of city names.

When I supply "name" for sectionNameKeyPath argument of initWithFetchRequest:managedObjectContext:sectionNameKeyPath:cacheName: method, it creates section for each city, which is obviously something I don't want. I can't figure out how to create an expression which would make it work in way I need.

thanks for any tips and/or advices on this

Matthes

John Calsbeek
  • 35,947
  • 7
  • 94
  • 101
  • 1
    Check out this prior, related question: [NSFetchedResultsController with sections created by first letter of a string](http://stackoverflow.com/questions/1112521/nsfetchedresultscontroller-with-sections-created-by-first-letter-of-a-string) – Toby Joe Boudreaux Aug 11 '09 at 15:02

0 Answers0