IOS / Core Data - how can I change sectionNameKeyPath from NSFetchedResultsController?

I announced that my fetchedResultsController is like this

NSFetchedResultsController *fetchController = [[NSFetchedResultsController alloc] 
initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext 
sectionNameKeyPath:@"date" cacheName:nil]; 

But when I click on UISegmentedControl, I want to change sectionNameKeyPath as @ "title".

Do you know a way to do this?

thank

+5
source share
1 answer

You will need to override FRC and resume the fetch request. Either set the class property to store the value of the current section NameKeyPath (set the default value in the viewDidLoad event), or you can pass it to the method that creates and executes the FRC.

+3
source

All Articles