• 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: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling
      • From: "Hamish Allan" <email@hidden>
References: 
 >NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling (From: "Ben Chen" <email@hidden>)
 >Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling (From: "Hamish Allan" <email@hidden>)

  • Prev by Date: Re: NSTimer problem
  • Next by Date: Re: Outline view selection doesn't move when items are inserted?
  • Previous by thread: Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling
  • Next by thread: Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling
  • Index(es):
    • Date
    • Thread