I am sorting results of a fetch request with a sort descriptor.
NSFetchRequest* req = [[NSFetchRequest alloc] initWithEntityName:[MyEntity entityName]];
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"property"
ascending:YES
selector:@selector(localizedCompare:)];
req.sortDescriptors = [NSArray arrayWithObject:descriptor];
return [self.managedObjectContext executeFetchRequest:req error:nil];
The problem is the words, which begins with non-english chars like 'İ' are listed at the end of the list. It is a turkish letter and the alphabet looks like this :
A, B, C, Ç, D, E, F, G, Ğ, H, I, İ, J, K, L, M, N, O, Ö, P, R, S, Ş, T, U, Ü, V, Y, Z.
So the letter is at 12th position.
I don't know why but using comparator after fetching objects works. So it works on any array but not with sort descriptor for fetch request.