开发者

tableView:heightOfRow: never called

I'm trying to get a row in my table view to resize its height, but the delegate method:

- (CGFloat) tableView:(NSTableView *)tableView heightOfRow:(NSInteger)ro开发者_如何学编程w

is never called. I have implemented other delegate methods and they work perfectly. Is there something I am not doing?

Thank you!


Can you confirm that you've implemented other delegate methods and not other datasource methods? A common error is to hook up your datasource but not your delegate. They're different outlets on an NSTableView.


Are you changing the row heights? From the docs:

Although table views may cache the returned values, you should ensure that this method is efficient. When you change a row's height you must invalidate the existing row height by calling noteHeightOfRowsWithIndexesChanged:. NSTableView automatically invalidates its entire row height cache when reloadData and noteNumberOfRowsChanged are called.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜