I want to implement something similar to the iPhone's Contact list. I know that there is an address book framework that allows me to access the device's contacts, but I want to use my own contacts stored in my Core Data database.
I am using NSFetchedResultsController
to fetch and list my contacts on a table view.
However, I can not seem to find a way to get NSFetchedResultsController
to display my contacts organized by section, being each section the first letter of each contact's name. Like:
Section A: All contacts that start with the letter A
Section B: All contacts that start with the letter B
etc...
I think that I can do this with the sectionNameKeyPath:
parameter in the init
method for NSFetchedResultsController
, but how am I supposed to use it to achieve my ends?