5
votes

Is there any way I can adjust the height of NSTextFieldCell in an NSTableView based on the amount of text in it?

In short, I want tableView:heightOfRow: to return a value according to the text in the corresponding NSTextFieldCell and keep updating every time the text increases from a pre-defined number of lines.

I can get the dynamic height the first time the table is loaded. But can't get a way of changing it when the text updates.

Thanks.

1

1 Answers

0
votes

Sounds like you'll need to call

[NSTableView reloadDataForRowIndexes:columnIndexes:] for all the data underneath the cell you're modifying, and of course [NSTableViewDelegate tableView:heightOfRow:].

This might be a helpful related question you can refer to.