I have a dates in Array like below and i want to sort it.
NSMutableArray *arrDates =[[NSMutableArray alloc]init];
[arrDates addObject:@"24/01/2010"];
[arrDates addObject:@"15/05/2014"];
[arrDates addObject:@"04/03/2011"];
[arrDates addObject:@"30/05/2013"];
[arrDates addObject:@"11/10/2012"];
I tried with below code but am not getting what should i pass exactly as a Key here.
NSSortDescriptor *sortDis = [[NSSortDescriptor alloc] initWithKey:????? ascending:TRUE];
[arr sortUsingDescriptors:[NSArray arrayWithObject:sortDis]];
I passed self but its sorting only based on date(day).
I want to display result as below
24/01/2010
04/03/2011
11/10/2012
30/05/2013
15/05/2014
and also i tried with below line
[arrDates sortUsingSelector:@selector(compare:)];
but no use. Please help.