Re: Adding items to an NSOutlineView
Re: Adding items to an NSOutlineView
- Subject: Re: Adding items to an NSOutlineView
- From: Scott Anguish <email@hidden>
- Date: Tue, 14 Oct 2003 16:43:43 -0400
On Oct 14, 2003, at 3:12 PM, Darrin Cardani wrote:
I have an NSOutlineView in one of my windows, and it works initially.
I create a single item for the list it's displaying, and it displays
the first item correctly and I can turn it down and see it's children.
However, when I add a second item to the list, it doesn't add the item
to the outline view. I've tried just calling this:
[ outlineView setNeedsDisplay:YES];
but it doesn't work. It appears that the NSOutlineView is not sending
its delegate the -numberOfChildren: message. I've tried:
[ outlineView reloadItem:nil reloadChildren:YES ];
but it raises an exception on the passed in item. I was hoping it
would use nil to mean the root object, like it expects the delegate to
use. Next I tried getting the actual object from my list and calling:
You should have the root object somewhere, and you could pass that.
Or.. NSOutlineView is a subclass of NSTableView.. have you tried just
using reloadData?
[ outlineView reloadItem:theItem reloadChildren:YES ];
It no longer raises an exception, but also does not show the new
object. So how do I get the view to realize that there's a new object,
and that it needs to display it?
You'd want to reload the parent of "theItem".
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.