View based NSTableView viewForTableColumn:row not called

拈花ヽ惹草 提交于 2019-12-06 13:09:09

It' simple! The problem was, even though the tableview was added to my view hierarchy, it was clipped so it couldn't be seen. NSTableView must do some checks to see if it's actually on screen and then only request cell views for visible rows.

Because the whole tableview was essentially "off-screen", it wouldn't request any rows.

My NSTableView is added by code instead of IB, I solved it by adding:

[tableView addTableColumn:[[NSTableColumn alloc]initWithIdentifier:@"columnIdentifier"]]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!