Re: Enable NSTableView ordering.
Re: Enable NSTableView ordering.
- Subject: Re: Enable NSTableView ordering.
- From: "Louis C. Sacha" <email@hidden>
- Date: Fri, 19 Dec 2003 07:22:45 -0800
Hello...
The order of the items that are displayed in an NSTableView is
determined by your datasource object. So, you need to provide the
items for the correct row/columns in the order you want when the
tableview calls the tableView:objectValueForTableColumn:row: method
in your datasource object.
If you want to be able to sort your data when a particular column
header is clicked on, one way to do it would be to assign your
datasource as the delegate of the tableView and implement the
delegate method
- (void)tableView:(NSTableView*)tableView
didClickTableColumn:(NSTableColumn *)tableColumn;
When this method is called, then you should sort your data for the
provided column. At the end of this method you would need to call
[tableView reloadData] so that the tableView will know that it needs
to refresh all of the displayed rows/columns with the new data you
just sorted.
Hope that helps,
Louis
How can I set NSTableView columns to order list?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.