1
linlinqi 2012-01-29 15:53:11 +08:00
用sortedArrayUsingComparator是不是可以呢
<pre> NSArray *sortedArray; sortedArray = [drinkDetails sortedArrayUsingComparator:^(id a, id b) { NSDate *first = [(Person*)a birthDate]; NSDate *second = [(Person*)b birthDate]; return [first compare:second]; }]; </pre> 见 http://stackoverflow.com/questions/805547/how-to-sort-an-nsmutablearray-with-custom-objects-in-it |
2
lizdo 2012-01-29 16:00:27 +08:00
楼上的改成NSNumber *first = [a objectForKey:xxx];就可以了
这种问题的确StackOverflow比较无敌 |