Pass nil
as your sectionNameKeyPath
when initializing your NSFetchedResultsController.
If you pass name
, you basically say "please create one section for each name". When passing nil
, you tell it to create only a single section.
You tableview method implementations look right to me.
[_fetchedResultsController sections]
gives you an array with objects that you can ask for things like the number of objects in a section. In contrast, [_fetchedResultsController sectionIndexTitles]
is mostly so you can tell the NSFetchedResultsController
which section titles to use (i.e you would set this to an array with one string for each section). In your case, you can just ignore it.