CoreData: error: (NSFetchedResultsController) The fetched object at index 72 has an out of order section name 'อั. Objects must be sorted by section name'
I am using the following code to sort by book title field and display book title's first upper case letter as the section name in a UITableViewController.
The code runs perfectly in all languages except of Thai. I read on the Internet that there are special non US characters causing such issues (i.e. Æ), but I didn't find any solution yet.
See gschandler response on The fetched object at index [i] has an out of order section name 'å
Code of FRC is
NSFetchedResultsController *aFetchedResultsController =
[[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
managedObjectContext:managedObjectContext
sectionNameKeyPath:@"titleFirstLetter"
cacheName:nil];
Code of firstLetter is:
- (NSString *)titleFirstLetter {
// support UTF-16:
NSString* val = [self.title substringWithRange:[self.title rangeOfComposedCharacterSequenceAtIndex:0]];
return [val uppercaseString];
}
Any suggestions?