• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: bug in PhotoSearch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSTableView NSTrackingArea and mouse clicks (From: "email@hidden" <email@hidden>)
 >Re: NSTableView NSTrackingArea and mouse clicks (From: Corbin Dunn <email@hidden>)
 >bug in PhotoSearch (From: "email@hidden" <email@hidden>)
 >Re: bug in PhotoSearch (From: Corbin Dunn <email@hidden>)
 >Re: bug in PhotoSearch (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: Storing values in dictionary with their address as the key
  • Next by Date: Re: global NSMutableDictionary
  • Previous by thread: Re: bug in PhotoSearch
  • Next by thread: Drawing a drop-shadow around a view
  • Index(es):
    • Date
    • Thread