0

I have number of arrays of dictionary

   points = 200;
   startDate = "Jun 04, 2011, 13:15 PM";

   points = 200;
   startDate = "May 01, 2011, 11:15 PM";

   and  -------

I have to do sorting on the basis of startDate.

I have used number of sorting's earlier like numerical.. alphabetical sorting etc via this method:

-(NSMutableArray*)SortEventsArray:(NSMutableArray*)arrayToSort :(NSString*)sortExpression
{
   NSSortDescriptor *mySorter = [[NSSortDescriptor alloc] initWithKey:sortExpression ascending:YES];
   [arrayToSort sortUsingDescriptors:[NSMutableArray arrayWithObject:mySorter]];
   return arrayToSort;
}

but its not working for Date string.

Please help

Tariq
  • 9,861
  • 12
  • 62
  • 103

1 Answers1

1

Chekout this

This one also

Both will help you.

Community
  • 1
  • 1
Rakesh Bhatt
  • 4,606
  • 3
  • 25
  • 38