Re: bug in PhotoSearch
Re: bug in PhotoSearch
- Subject: Re: bug in PhotoSearch
- From: Corbin Dunn <email@hidden>
- Date: Tue, 29 Jul 2008 15:51:35 -0700
howdy ken,
it seems to me that all drawing of table cells will go first thru
preparedCellAtColumn:row:, next to the delegate method
tableView:willDisplayCell:forTableColumn:row:, then thru the table's
drawRect: and finally to the appropriate cell's drawing methods
(altho i may have the order wrong, and it may be that drawRect calls
preparedCellAtColumn:row,
tableView:willDisplayCell:forTableColumn:row:, and the cell's
drawing methods).
You can find out by breaking on your methods and looking at the
backtrace for any particular method (or, break on appkit methods - you
just won't have source). It works as follows:
table needs to draw, thus, the following calls happen (simplified
model):
drawRect() {
for (each row to draw) {
drawRow(row) {
cell = preparedCellAtRow() {
setup the cell's properties
call willDisplayCell.. last
}
[cell drawInRect..]
}
}
}
since the sample code's (and my) mouse entered/exit methods simply
indicate that the cell rect needs to be displayed, drawing caused by
entering/exiting a cell's tracking area will go thru the same
sequence. (is this correct?) thus, unless some cell drawing is done
outside the normal mechanism (via some direct draws or draws from
another thread), there should be no reason to cache the cell.
It's not necessarily another thread, but something else, ie: a view
behind your tableview, could (for some reason) need to be redrawn, and
the table would subsequently need to be redrawn at that part.
Basically, if it works for the cases your using, then there is no
reason to copy the cell. But, in the end, copying the cell is very
lightweight.
--corbin
so... (since i readily grant that u have much more knowledge than i
do), what am i missing? :-)
thanx,
ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden