One of several options would be using a comparator block. You didn't provide enough informations, so I made some assumptions:
- The date string is at the 3rd index of the NSArrays
- The date string looks like 31-12-2011
Code
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:@"dd-MM-yyyy"];
array = [array sortedArrayUsingComparator: ^(id a, id b) {
NSArray *array1 = (NSArray *)a;
NSArray *array2 = (NSArray *)b;
NSDate *date1 = [dateFormatter dateFromString:[array1 objectAtIndex:2]];
NSDate *date2 = [dateFormatter dateFromString:[array2 objectAtIndex:2]];
return [date1 compare:date2]
}
But you should also consider to have an class representing the data.
In that case you would inter ate over the raw dater and create a object for every data set, put it in an NSMutableArray and sort this. similar.