I have a list of data which I am able to sort by clicking on the column header. The only problem is that it displays like:
10A
11A
12A
1A
2A
3A
etc...
Where ideally, I would like it to be sorted like:
1A
2A
3A
4A
5A
6A
7A
8A
9A
10A
11A
etc...
Is there any way to get around this default sorting action?
These are my sort descriptors properties:
@Monolo:
self.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"self"
ascending:YES
comparator:^NSComparisonResult(id obj1, id obj2) {
NSLog(@"COMPARATOR!");
return [obj1 compare:obj2
options:NSNumericSearch];
}]];