The following code is from the accepted answer of this post, regarding with implement search bar in table view with Core Data. It uses two fetched results controller (FRC). One for the "normal" table view, one for search results table view. And it uses a helper method to decide which FRC to use for table view data source methods, FRC delegate methods, etc..
I understand most of the code except the following part. What code should I put in to replace the comments "update the filter..."
? And why should I set the self.searchFetchedResultsController and its delegate to nil?
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSInteger)scope
{
// update the filter, in this case just blow away the FRC and let lazy evaluation create another with the relevant search info
self.searchFetchedResultsController.delegate = nil;
self.searchFetchedResultsController = nil;
...
}