I have a view controller that's the delegate for 2 tables, a view based table and a cell based table. The cell based table is calling viewForTableColumn
when it should be calling objectValueForTableColumn
. I made doubly sure it was a cell based table in the interface builder.
If the delegate of the NSTableView
implements the method tableView:viewForTableColumn:row:
, the NSTableView
automatically switches to view based.
You'll have to make different delegates for the 2 table views
View-Based Table Views and Cell-Based Table Views do not mix, you can either have two different delegates or you can turn the cell bases table to a view based table and then use the following code in tableView:viewForTableColumn:row:
to make it look like a cell-based table:
NSTableCellView *cell = [tableView makeViewWithIdentifier:@"textFieldCell" owner:self];
where textFieldCell
is the identifier of the cell. Then you set the string you want to appear in the cell using this code:
[[cell textField] setStringValue:desiredString];
at the end of the method return the variable cell
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With