I have a NSOutlineView, some of those have children some don't. I would like to deselect, or close the previous selection when a selection is made on other cell.
I hope I can be explanatory with these screen shots.
Here we have Two Parent Folders, Folder 1 and Folder 2. I want to deselect Folder 1 on selecting the disclosure triangle of Folder 2.
Something like this, using the
-(BOOL)outlineView:(NSOutlineView *)outlineView shouldExpandItem:(id)item;
-(BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(id)item;
I haven't found a way out.
Thanks
Implement this delegate and use something similar :
Here
parent
is the top level item array, as in your example Folder1 and Folder2.EDIT:
Appdelegate.h
Appdelegate.m
With one more method written on top.
And set the delegate of NSOutlineView to AppDelegate in IB.