• 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:48:39 -0800


On Jan 17, 2008, at 10:35 AM, Hamish Allan wrote:

On Jan 17, 2008 6:24 PM, Corbin Dunn <email@hidden> wrote:

Why cache certain things since your datasource should already have them in the 'model'?

Because you know the very next fetch will always be for exactly the same data?

No, this frequently isn't true, and it is the primary reason why a caching model can't be directly added to NSTableView (side note, NSOutlineView, which has an item-based model, does cache things. NSTableView has a row-based model).


People frequently do this type of thing when they want a cell to redraw its contents at row/column, but not redraw anything else:

[tableView setNeedsDisplayInRect:[tableView frameOfCellAtColumn:column row:row]];

The above way of redrawing a particular cell is very efficient. If we introduced caching, the above would no longer work.

Of course, a caching mechanism could be introduced, but it would require user adoption and new API. For instance, the above issue would require new API to invalidate the internal cache for a given row/ column pair.

Feel free to log such things as feature requests for AppKit. What you are wanting is basically a lazy-push model (all the data is pushed into the view lazily) as opposed to the current lazy pull model (all the data is pulled when the view needs it).

thanks,
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>)
 >Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling (From: Corbin Dunn <email@hidden>)
 >Re: NSTableView: tableView:objectValueForTableColumn:row called more than necessary when scrolling (From: "Hamish Allan" <email@hidden>)

  • Prev by Date: Re: Outline view selection doesn't move when items are inserted?
  • 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