• 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: Controlling rootElement Display in outline view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controlling rootElement Display in outline view


  • Subject: Re: Controlling rootElement Display in outline view
  • From: Corbin Dunn <email@hidden>
  • Date: Wed, 24 Sep 2008 09:03:46 -0700

When the outline asks this with a nil 'item':

- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item;

Don't return 1, but instead, return the number of children in your root item.

Then, when this is asked with a nil 'item':

- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item;

Return the children from your root node, and not the root node itself.

Ideally, you want some new delegate method, like: - outlineViewRootItem. That doesn't exist.

corbin


On Sep 23, 2008, at 11:12 AM, Thomas Lennon wrote:


I was working through the “Using Tree Controllers With NSXML Objects”.

http://developer.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/Art
icles/UsingTreeControllers.html#//apple_ref/doc/uid/TP40003565

I have an XML file and have coded following the example referenced above and
all works fine and as expected. What I cannot figure out is how to avoid
displaying the root element of the XML Document.
In my case the XML Document is a list of items and the rootElement is a
description of the list. I want my outline view to display the list and not
the list description.

_______________________________________________

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: 
 >Controlling rootElement Display in outline view (From: Thomas Lennon <email@hidden>)

  • Prev by Date: NSOperation NSOperationQueue
  • Next by Date: Re: binding to static text
  • Previous by thread: Controlling rootElement Display in outline view
  • Next by thread: issues with mainMenu and initialization timing
  • Index(es):
    • Date
    • Thread