• 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: NSOutlineView expand-by-default with NSTreeController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView expand-by-default with NSTreeController


  • Subject: Re: NSOutlineView expand-by-default with NSTreeController
  • From: Benjamin Rister <email@hidden>
  • Date: Tue, 8 Dec 2009 08:24:00 -0500

On Dec 5, 2009, at 6:11 PM, Jason Foreman wrote:

> 	[[treeController arrangedObjects] childNodes];
>
> Iterate over this collection and find nodes where [node representedObject] is equal to your newly inserted objects.  Then you can pass this NSTreeNode instance to -[NSOutlineView exandItem:].
>
> This isn't terribly clean, and it might fall down if you have a large number of items in your tree controller, but it works for what I need and might work for you.

Thanks, Jason.

Unfortunately, the content can still be fairly large, so I’m not sure about how the performance of a brute force method like this will be. On the other hand, premature optimization is the root of all evil, and this is really easy to implement. It might not be a bad idea to just do this for now, don’t worry about the inefficiency, see how it works for the content sizes that a human could deal with, and just revisit the question if it ends up being a practical problem.

So if anybody has a cleaner solution (which I’m guessing by the silence they don’t), I’m all ears. Otherwise I’ll try this, and just fall back to rewriting NSTreeController myself if the performance doesn’t work out. (Is there any open source NSTreeController reimplementation out there?)

Best,
Benjamin Rister_______________________________________________

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: 
 >NSOutlineView expand-by-default with NSTreeController (From: Benjamin Rister <email@hidden>)
 >Re: NSOutlineView expand-by-default with NSTreeController (From: Jason Foreman <email@hidden>)

  • Prev by Date: Re: IKImageBrowserView image quality changing with redraw
  • Next by Date: Unable to write in InfoPlist.strings file from cpp
  • Previous by thread: Re: NSOutlineView expand-by-default with NSTreeController
  • Next by thread: [iPhone] Add a UIProgressView as subview to a navigationController
  • Index(es):
    • Date
    • Thread