由字典组成的数组根据key排序

NSArray *array = [NSArray array];
    [array sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2){
        NSNumber index1 = [obj1 valueForKey:@"index"];
        NSNumber index2 = [obj2 valueForKey:@"index"];
        return [index1 compare:index2];
    }];
posted @ 2016-03-19 23:12  杨大龙dalong  阅读(239)  评论(0编辑  收藏  举报