Problem with the name NSTableColumn

I am trying to create a column with an empty row as an identifier, but Cocoa seems to replace the empty row with the word "Field" every time I try to create a column. How do you get around this?

- (void)addColumnWithCheckboxToTable:(NSTableView *)table { // Add column with checkbox before all other columns // This column will have no title and should be as wide as the checkbox NSTableColumn *column = [[[NSTableColumn alloc] initWithIdentifier:@" "] autorelease]; // The checkbox is to be initialised without a title NSButtonCell *checkbox = [[[NSButtonCell alloc] initTextCell:@" "] autorelease]; [checkbox setEditable:YES]; [checkbox setButtonType:NSSwitchButton]; [checkbox setImagePosition:NSImageOnly]; [checkbox setControlSize:NSSmallControlSize]; // Add column with checkbox to table [column setDataCell:checkbox]; // Add column to table [table addTableColumn:column]; } 
+4
source share
1 answer

The column identifier does not match its name. You want to set its string value to -headerCell:

 [[columnColumn headerCell] setStringValue:@""]; 
+10
source

Source: https://habr.com/ru/post/1299348/


All Articles