Reputation: 46310
I created a fresh project with a core data template. then I added a employee entity with a firstName string attribute, and populated the persistent store with 100 employees and lots of different first names.
In the RootViewController where the FRC is created, I set the sectionNameKeyPath like this:
NSFetchedResultsController *frc = [[NSFetchedResultsController alloc]
initWithFetchRequest:fetchRequest
managedObjectContext:managedObjectContext
sectionNameKeyPath:@"firstName"
cacheName:@"Root"];
However, I never see any sections or titles. Probably I must activate this somewhere?
Upvotes: 0
Views: 60
Reputation: 64428
You have to make sure that the data source methods return section information. Check that numberOfSectionsInTableView:
returns the proper number of sections and that sectionIndexTitlesForTableView:
returns the proper titles.
Upvotes: 2