I\'ve got an array of NSDates and I\'d like to grab the largest NSDate from the array. While i could always sort them and grab the first/last, is there a way to do this with
Agree with @SeanDanzeiser. To be more specific, here's a ~70 byte one-liner:
// if dateArray is the array of dates ... NSDate *maxDate = [[dateArray sortedArrayUsingSelector:@selector(compare:)] lastObject];