I am working on sorting data NSFetchedResultController. I need to sort the data by their name. However, there are some records without a name.
I need the "untitled" objects to appear at the bottom of the list, and not at the top. With the current code, when I sort the list by name, the cells "no first name" are placed at the top.
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Contacts"];
request.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"firstName" ascending:YES]];
_FRC = [[NSFetchedResultsController alloc] initWithFetchRequest:request
managedObjectContext:MOC
sectionNameKeyPath:nil cacheName:nil];
_FRC.delegate = self;
source
share