I use this sort descriptor
NSArray *sortedObjects = [self.array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:[NSSortDescriptor sortDescriptorWithKey:@"index" ascending:YES], nil]];
The result is 10 and 11 are sorted alongside 1 and placed before 2.
index is 1/12
index is 10/12
index is 11/12
index is 2/12
index is 3/12
index is 4/12
index is 5/12
index is 8/12
index is 9/12
How can this be avoided?
Use your own comparison with
or
another sort that allows a custom comparator.
Then split up the days and compare the month and then the day.