I usually do such things in -windowDidLoad. Suppose your subclass of NSWindowController has an IBOutlet _arrayController installed in the corresponding NSArrayController, and that your model has the buildETA property:
NSSortDescriptor *buildETASortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"buildETA" ascending:NO]; [_arrayController setSortDescriptors:[NSArray arrayWithObject:buildETASortDescriptor]]; [buildETASortDescriptor release];
Edit: Changed -awakeFromNib to -windowDidLoad since this is a hypothetical subclass of NSWindowController
source share