tableview 设置标题

How to change the title of column and reflect the change without the need to reload the data ?


[[myTableColumn headerCell] setStringValue:myNewTitle] ;
[[myTableView headerView] setNeedsDisplay:YES];

You could also put that code in a NSTableColumn category for easy re-use:

@interface NSTableColumn(SetTitle)

- (void)setTitle:(NSString *)inTitle
{
    [[self headerCell] setStringValue:inTitle] ;
    [[[self tableView] headerView] setNeedsDisplay:YES];
}

@end
原文地址:https://www.cnblogs.com/watchdatalearn2012620/p/2978662.html