Where's the best place to put noteHeightOfRowsWithIndexesChanged to keep a tableview display correct whilst scrolling?

The tableview has variable height rows, and because of a relatively slow data source, resizing and user control of fonts, etc, I don't know the row height in advance. I'm caching the row height, and returning a single-line height if the row is not visible (and the height is not yet known). If the row is visible I calculate the actual height and return that (via the NSTableView heightOfRow delegate).

This almost works, but I've not found a good place to put noteHeightOfRowsWithIndexesChanged. I get either overlapping rows or some blank rows during scroll. I've tried NSViewBoundsDidChangeNotification. I've even tried putting it in the heightOfRow delegate (which I know must be wrong), with some re- entrancy control which has given the best results so far (but still displays blank rows sometimes). There are usually about 200,000 rows, so calculating the actual height for all rows is not an option (since it takes about 19 seconds).

Any ideas anyone?

Tony
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to