Reputation: 5510
I am sorting an NSArray of NSDictionaries which is working using the following code
NSArray *getIndexArray = [nicknamesCombinedArray copy];
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"MANUFACTURER" ascending:YES];
NSDictionary *sortedGetIndexArray = [getIndexArray sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]];
The only issue is that when it sorts if the word is all CAPS then it sorts like this
JESS
Jack
Jelly
Job
Where I would like it to be
Jack
Jelly
JESS
Job
Upvotes: 0
Views: 64
Reputation: 1214
Try this code..
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"MANUFACTURER" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)];
Upvotes: 3