views:

17

answers:

2

Hi there. 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)row

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

Thank you!

+1  A: 

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.

Rob Napier
Ooooh, wow. I should have checked that more carefully. Thank you, I was confused about it. Thanks!
Alberto
A: 

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.

Noah Witherspoon