I've created an NSTableView programmatically and added a single column (an instance of NSTableColumn). How can I set the name of this column (by default it's named "Field")? In NSTableColumn there's a method with signature
- (void)setHeaderCell:(NSCell *)aCell
but "[t]his method is only valid for cell-based table views", and I am using a view-based table view.
The NSTableView itself contains an instance of NSTableHeaderView, which contains an instance of NSTableHeaderCell. NSTableHeaderCell is a subclass of NSTextFieldCell, which looks good, since it has a setString method. But I can't access the NSTableHeaderCell! So how then can I set the column name? I assume it's trivial to do it: after all, being able to set the column names in a table view is pretty much the most important thing to be able to do with a table view, but after hours of searching I haven't found a single clue on how to do it.