if (lastColumn == tableColumn) {
// User clicked same column, change sort order
sortDescending = !sortDescending;
} else {
// User clicked new column, change old/new column headers,
// save new sorting selector, and re-sort the array.
sortDescending = NO;
if (lastColumn) {
[self setIndicatorImage: nil
inTableColumn: lastColumn];
}
}
lastColumn = [tableColumn retain];
[self setHighlightedTableColumn: tableColumn];
[listOfMsg sortUsingSelector: [[tableColumn sortDescriptorPrototype]
selector]];
if (sortDescending) [self reverse: listOfMsg];
[self reloadData];
}
- (void)reverse:(NSMutableArray *) _list {
int i;
for (i=0; i<(floor([_list count]/2.0)); i++) {
[_list exchangeObjectAtIndex:i withObjectAtIndex:([_list count]-(i+1))];
}
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden