Use sortedArrayUsingComparator
method to sort NSArray with custom object
NSArray *sortedArray = [list sortedArrayUsingComparator:
^NSComparisonResult(CustomObject *obj1, CustomObject *obj2){
return [obj1.attr1 compare:obj2.attr1];
}];
Use sortedArrayUsingComparator
method to sort NSArray with custom object
NSArray *sortedArray = [list sortedArrayUsingComparator:
^NSComparisonResult(CustomObject *obj1, CustomObject *obj2){
return [obj1.attr1 compare:obj2.attr1];
}];