Re: NSTableView: programatically changing sorted column

2010-07-05 Thread Graham Cox
On 06/07/2010, at 1:28 PM, Kyle Sluder wrote: > I would argue that's less of a concern than inverting the > responsibilities of your controller and view layers. If "the sort > descriptors in use" is a concept that exists outside of the table > view, it really doesn't make sense to make the table

Re: NSTableView: programatically changing sorted column

2010-07-05 Thread Graham Cox
Hi Scott, Yes I'm implementing the delegate method. Sorting is working just fine: when I click the column headers sort descriptors are updated, the delegate is informed, the controller does its thing with the data and all is well. The issue is when I try to accomplish this programatically (from

Re: NSTableView: programatically changing sorted column

2010-07-05 Thread Kyle Sluder
On Mon, Jul 5, 2010 at 7:36 PM, Graham Cox wrote: > I was hoping to avoid it because if I do that I have to duplicate the work > that NSTableView does to maintain its list of sort descriptors. Since > NSTableView already manages this list, it's easy to use. I would argue that's less of a concer

Re: NSTableView: programatically changing sorted column

2010-07-05 Thread Scott Anguish
are you implementing the delegate method? - (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors { // the sort descriptors are specified in Interface Builder for the lastName column and the relationship column // the both specify the respec

Re: NSTableView: programatically changing sorted column

2010-07-05 Thread Graham Cox
On 06/07/2010, at 12:02 PM, Kyle Sluder wrote: > Have you tried making a canonical sortDescriptors property on an > appropriate controller (probably a window controller or view > controller) and binding both the table view and icon view's > sortDescriptors to this property? This seems more approp

Re: NSTableView: programatically changing sorted column

2010-07-05 Thread Kyle Sluder
On Mon, Jul 5, 2010 at 6:50 PM, Graham Cox wrote: > Note that I want to do this for good reason: I have two alternative views of > some data, a table view and an icon view. The icon view is sorted to match > the table view, so I rely on the table's sort descriptors for both views. > When I chan

NSTableView: programatically changing sorted column

2010-07-05 Thread Graham Cox
I want to programatically change the column on which items are sorted in NSTableView. When I call -setHighlightedTableColumn:, it does change the highlighted column, but annoyingly, nothing is done with the table's sort descriptors. I can't see any API for triggering a proper update to the sort