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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to