Re: Retrieving the selected object in an NSOutlineView.

Christiaan Hofman <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Sep 18, 2009, at 19:18, Joshua Garnham wrote:

> I
> am looking to retrieve the selected object in an NSOutlineView so I  
> can
> see if the selected object has any children. How would I do this?
> I know the NSTreeController has selectedObject but how would I  
> implement this and then check if it has children.
> Cheers!


Your question is really not very clear. But if I understand you  
correctly, you want to know how to access properties like the count of  
the children of the real objects in your model object corresponding to  
the selection in the NSTreeController to which the NSOutlineView is  
bound. All you need to know for this is that the objects managed by  
the NSTreeController are wrappers of class NSTreeNode. From there the  
answers should be obvious from the documentation of this class.

Christiaan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.