I spent several hours to find how to do this, all topics are discussed by iOS, not Mac, I want to control the table title by changing the height, background color, font, etc., like in another table. Cell ... any body helps me please!
I did the code below to change the heading for column 0, but the result would be: a heading with the text "name", but without color and line height!
NSTableHeaderCell *cell = [[NSTableHeaderCell alloc]initTextCell:@"name"];
[cell setBackgroundColor:[NSColor redColor]];
[cell drawWithFrame:NSMakeRect(0, 0, 20, 30) inView:[[tableView tableColumns] objectAtIndex:0]];
[[[tableView tableColumns] objectAtIndex:0] setHeaderCell:cell];
also i tried using this
NSTableHeaderView *headerView = [[NSTableHeaderView alloc]initWithFrame:NSMakeRect(0, 0, 120, 60)];
[tableView setHeaderView:headerView];
But I have the same original title with my custom view in reverse (both)
source
share