I am trying to show in UITableViewController
my items stored in Core Data in a specific order given by one of its attributes. There is an attribute that can be 1 or 0 and my intention is to show first those whose value is 1.
NSFetchRequest *req = [NSFetchRequest fetchRequestWithEntityName:@"MyContacts"];
req.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"value" ascending:YES]];
NSFetchedResultsController *results = [[NSFetchedResultsController alloc]initWithFetchRequest:req managedObjectContext:self.Model.context sectionNameKeyPath:nil cacheName:nil];
ContactsViewController *cVC = [[ContactsViewController alloc]initWithFetchedResultsController:results style:UITableViewStylePlain]';
This is my code, but it does not sort the list.
Any help would be great.