Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling
Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling
- Subject: Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling
- From: Corbin Dunn <email@hidden>
- Date: Thu, 17 Jan 2008 10:24:29 -0800
I suspect the designers of NSTableView decided to save themselves
having to cache values for the currently-selected row (which would
later be needed to redraw that row unhighlighted) and in doing so
doomed the rest of us to have to write such code in every single
datasource.
Or, the exact opposite. Why cache certain things since your datasource
should already have them in the 'model'? The tableview is purely a
display mechanism for the visible rows.
As John said, this method must be fast. To quote the documentation:
Note: tableView:objectValueForTableColumn:row: is called each time
the table cell needs to be redisplayed, so it must be efficient.
As others have mentioned -- if your current implementation is too
slow, then you will need to implement a proxy layer that caches the
values.
corbin
_______________________________________________
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