• 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: [SOLVED] NSOutlineView not lazy when expanding items
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED] NSOutlineView not lazy when expanding items


  • Subject: Re: [SOLVED] NSOutlineView not lazy when expanding items
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 29 Sep 2014 10:40:35 -0700

To recap where we left off on Sept 19, the issue is that when an item in an NSOutlineView is expanded, its data source receives -outlineView:child:ofObject: once for *every* child, even if the item has 20,000 children but only 20 can fit in the window, causing poor performance if getting the child has a significant cost.

A workaround is to make the data source “lazy”.  Method -outlineView:child:ofObject: should create and return a proxy object containing only the passed-in ‘child' and ‘object’ parameters, while the other three NSOutlineViewDataSource methods, which AppKit invokes lazily, get this proxy and do the heavy lifting of fetching or filtering the actual item from the data model.

I’ve modified the demo project to show both “dumb” and “lazy” data sources.

https://github.com/jerrykrinock/NSOutlineViewLazinessDemo


_______________________________________________

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: 
 >Want NSTableView NSOutlineView to load lazy like iOS? (From: Jerry Krinock <email@hidden>)
 >Re: Want NSTableView NSOutlineView to load lazy like iOS? (From: Ken Thomases <email@hidden>)
 >Re: Want NSTableView NSOutlineView to load lazy like iOS? (From: Jerry Krinock <email@hidden>)
 >Re: Want NSTableView NSOutlineView to load lazy like iOS? (From: Ken Thomases <email@hidden>)
 >Re: Want NSTableView NSOutlineView to load lazy like iOS? (From: Jerry Krinock <email@hidden>)
 >Re: Want NSTableView NSOutlineView to load lazy like iOS? (From: SevenBits <email@hidden>)
 >Re: NSOutlineView not lazy when expanding items :( (From: Jerry Krinock <email@hidden>)
 >Re: NSOutlineView not lazy when expanding items :( (From: Jens Alfke <email@hidden>)
 >Re: NSOutlineView not lazy when expanding items :( (From: Jerry Krinock <email@hidden>)
 >Re: NSOutlineView not lazy when expanding items :( (From: Kyle Sluder <email@hidden>)
 >Re: NSOutlineView not lazy when expanding items :( (From: Jerry Krinock <email@hidden>)
 >Re: NSOutlineView not lazy when expanding items :( (From: Corbin Dunn <email@hidden>)
 >Re: NSOutlineView not lazy when expanding items :( (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: -[NSTabView mouseDown:] blows stack in Yosemite SDK
  • Next by Date: Deferred purchase testing in the App Store sandbox?
  • Previous by thread: Re: NSOutlineView not lazy when expanding items :(
  • Next by thread: Re: NSOutlineView not lazy when expanding items :(
  • Index(es):
    • Date
    • Thread