- (NSArray *) sortArray:(NSArray *)array :(BOOL)inAscending {
if (inAscending) {
return [array sortedArrayUsingSelector:@selector(compare:)];
}
else {
NSArray *ascendArray = [array sortedArrayUsingSelector:@selector(compare:)];
return [[ascendArray reverseObjectEnumerator] allObjects];
}
}
No comments:
Post a Comment