views:

11

answers:

1

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?

+2  A: 

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.

TechZen
Yeah, that makes sense. Too much stuff in the forest ;)
dontWatchMyProfile