tags:

views:

1085

answers:

3
+4  A: 

Look at NSSortDescriptor.

You can set it up using -setSortDescriptors: on the NSTableView. Or you can put the sort descriptors in an ivar and bind them with the Sort Descriptor binding in IB.

Nathan Kinsinger
+1  A: 

I typically do this sort of thing in -awakeFromNib. Suppose your NSWindowController subclass has the IBOutlet _arrayController set to the NSArrayController in question, and that your model possesses the property buildETA:

NSSortDescriptor *buildETASortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"buildETA" ascending:NO];
[_arrayController setSortDescriptors:[NSArray arrayWithObject:buildETASortDescriptor]];
[buildETASortDescriptor release];
sbooth
This doesn't seem to update the view to indicate that it's sorted that way.
Dustin
+3  A: 

Today (seemingly by coincidence), Simone Manganelli published a blog post with the solution.

Peter Hosey