• 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: Fastest way to "ExpandAll" in NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fastest way to "ExpandAll" in NSOutlineView


  • Subject: Re: Fastest way to "ExpandAll" in NSOutlineView
  • From: James Bucanek <email@hidden>
  • Date: Tue, 6 Jun 2006 07:25:01 -0700

Jeremy Dronfield wrote on Tuesday, June 6, 2006:

>
>On 6 Jun 2006, at 9:03 am, Darkshadow wrote:
>
>> Those will only expand or collapse the root item's children, and
>> not children of the children (and so on), though.
>
>This is wrong. -expandItem:expandChildren: is recursive; it expands
>the item, its children and children's children etc. -
>collapseItem:collapseChildren: is also recursive.

Jeremy's correct. But I will point out one quirk about expandItem:expandChildren:. While it's behaviour is recursive, the method itself it not. That is, it doesn't call itself with each child that its going to expand or collapse.

I discovered this fact when overriding the method in attempt to short-curcuit its normal behavior. I have an outline browser that could potentially expand to millions of records, each of which must be read from a database. Allowing the user to option-click one of the top-level nodes would have been a disaster. I thought that I could override this and allow one or two levels of children to be expanded, but change the expandChildren: argument to NO for anything deeper than that -- but it doesn't work that way.

--
James Bucanek
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Fastest way to "ExpandAll" in NSOutlineView (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: How to write a dictionary into an output file
  • Next by Date: Re: RE: Re: My app does not display its version in the finder
  • Previous by thread: Re: Fastest way to "ExpandAll" in NSOutlineView
  • Next by thread: Re: Fastest way to "ExpandAll" in NSOutlineView
  • Index(es):
    • Date
    • Thread