I struggled with the exact same problem today.
It seems that binding the content and selectionIndexes of the tableView to the array controller IB > inspector window > select your tableView > bindings tab, disables the sorting by clicking on the table header. This makes sense, because the table view now shows you the exact contents (and ordering) of the array controller.
I unchecked these bindings in the IB, also removed any sort keys from the table columns IB > inspector window > select your NSTableColumn > attributes pane. Select the checkbox Creates Sort Descriptor in the table column's binding tab. No sortDescriptor is needed on the table, although I think binding the table's sortDescriptor to Shared User Defaults Controller saves the ordering when you quit your application.
If you need to sort your table, put a sortDescriptor on the array controller, maybe in the awakeFromNib.
- (void)awakeFromNib {
[super awakeFromNib];
[self setSortDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"propertyOfYourObject" ascending:YES selector:@selector(compare:)]]];
}
This does not interfere with clicking the table column headers.
I couldn't get a sortDescriptor on the array controller to work with bindings.