NSArray *arr2=@[@"小雨",@"安安",@"小风",@"荣荣",@"张涛",@"李文荣"];

        NSComparator sortblock1=^(id obj1,id obj2){

            return [obj1 localizedCompare:obj2];

        };

        NSArray *sortarray1=[arr2 sortedArrayUsingComparator:sortblock1];

        for(id str in sortarray1){

            NSLog(@"%@",str);

        }

    }

    return 0;

}

 

posted on 2016-01-11 17:27  哦呵呵呵哦  阅读(347)  评论(0编辑  收藏  举报