Close the analog using NSMutableArray:
[opponentMatchDicts sortUsingFunction:compareMatchByDate context:nil]; ... static int compareMatchByDate( id m1, id m2, void *context) { NSDictionary *mDict1 = (NSDictionary *) m1; NSDictionary *mDict2 = (NSDictionary *) m2; NSDate *date1 = [mDict1 objectForKey:kMatchNSDate]; NSDate *date2 = [mDict2 objectForKey:kMatchNSDate]; int rv = [date1 compare:date2]; return rv; }
source share