objective 排序

NSMutableArray *sortedArray;

    sortedArray = [array sortedArrayUsingComparator:^NSComparisonResult(id a, id b)

    { double first = [(People*)a getValueA];

        double second = [(People*)b getValueA];

        return second-first;

    }];

 

更多:

http://iphone.xiaoxiaostudio.net/2012/11/20/%E5%A6%82%E4%BD%95%E7%BB%99nsmutablearray%E6%8E%92%E5%BA%8F/

posted @ 2013-04-05 20:24  Peter_youny  阅读(115)  评论(0编辑  收藏  举报