I am using NSTreeController with NSOutlineController to display contents in 1parent-1child hierarchy.
My structure is like this:
- parent
- child
- parent
- child
Now when user press a refresh button, I want to remove all the nodes and refill it again.
[[treeController arrangedObjects] removeAllItems];
[[treeController arrangedObjects] removeAllObjects];
but nothings seems to be working.
I guess binging NSTreeController with NSArrayController should help but I really don't know steps to bind -NSArrayController-NSTreeController-NSOutlineController.
From the documentation for the
contentproperty:If your content is an array (presumably an
NSMutableArray), thenwould be appropriate. Setting it to
nilremoves the underlying container. If your content is a single object, thenis the correct choice.