iOS: sorting an NSArray of core data objects
This question already has an answer here:
NSMutableArray *sortedArray;
sortedArray = [array sortedArrayUsingComparator:^NSComparisonResult(id a, id b) {
NSNumber *s1 = @([(Struct *)a value]);
NSNumber *s2 = @([(Struct *)b value]);
return [s1 compare:s2];
}];
链接地址: http://www.djcxy.com/p/70834.html
上一篇: 多类的Java泛型通配符