I'm having difficulty understanding how to update my fetchedresultscontroller with a new sort. I initialize a frc the standard way in my class. But how exactly do you modify the fetchrequest with a new sortdecription? My app has a sort selector in the appSettings that the user can change on the fly. Is there a way to update the frc dynamically? The code below is what I have in the viewWillLoad callback, but it just produces a blank table. Thanks!
[self appSettingSortOrder];
if (sortOrderChanged) {
//Form a new fetchrequest for the FRC and reload the table.
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Aircraft" inManagedObjectContext:managedObjectContext];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:entity];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:currentSortOrder ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
NSError *error = nil;
[fetchedResultsController performFetch:&error];
[self.tableView reloadData];
[fetchRequest release];
[sortDescriptor release];
[sortDescriptors release];
}