Re: Subclassing NSTableView
Re: Subclassing NSTableView
- Subject: Re: Subclassing NSTableView
- From: Ondra Cada <email@hidden>
- Date: Fri, 26 Oct 2001 12:14:40 +0100
Drew,
>
>>>>> Drew McCormack (DMC) wrote at Fri, 26 Oct 2001 09:43:39 +0200:
DMC> >Just imagine a table of 50.000 rows, the vertical scroller somewhere in
DMC> >the middle. Given the current design (assuming that all rows do have
DMC> >the same
DMC> >height), this is no problem at all. With different row heights this
DMC> >would be
DMC> >a huge performance problem.
...
DMC> I suspect that the rowsInRect: method would be used to determine which
DMC> rows to draw. Does anyone else know if this is right?
Yep, it's not right.
Forget the particular API and tell me: if one clicks into the middle area of
the scroller, how would the tableview determine which rows to show?
Unless _all_ (ar at least all to the clicked point) row heights are fetched
(which would be the aforementioned "huge performance problem"), there is no
way to guess whether, say, first 1000 rows happen to be much higher than the
rest and so the "middle" happens to be somewhere around row #900, or whether
the last 1000 happens to be much higher, so the "middle" happens to be
somewhere around #49100.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc