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 17:50:22 -0400
At 4:43 PM -0400 10/14/03, Scott Anguish wrote:
You should have the root object somewhere, and you could pass that.
From what I can tell, the NSOutlineView doesn't actually have any
knowledge of the root object. When it wants the delegate to do
something with the root object (like report the number of children it
has), it passes nil to the delegate. (That's why I thought passing it
nil for the item to reload would do the trick. But it didn't.) If I
passed the actual root object to -reloadItem:, I suspect it would just
raise a bad param exception, like when I passed it nil. (But I have to
admit, I haven't actually tried that.)
Right.. NSOutlineView doesn't have that stored anywhere, so when you
send it a 'nil', it doesn't have the root object to use.. and it
doesn't really have the facility to ask the delegate for just the
object (and not for a specific data column)..
However, in order to provide the data in the datasource method, you
will need to have the root object somewhere, so it's your
responsibility.
You should be able to send the root object to it without any problem..
if you get a bad param exception I'd be surprised and would want to
look into it further.
Or am I not understanding what you're saying?
NSOutlineView is tricky. Especially since there isn't an Foundation
data class that directly maps to a tree (although NSDictionary can be
used like that)..
_______________________________________________
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.