I need to perform an operation on all objects in my NSOutlineView when I close the window.
(Both parents and children, and children of children).
It doesn’t matter if the items are expanded or not, I just need to perform a selector over all items in the outline view.
thanks
Assuming you’re using NSOutlineViewDataSource and not bindings, you could do it like this:
This should achieve a full traversal of all the objects vended by your
NSOutlineViewDataSource.FYI: If you’re using cocoa bindings, this won’t work as is. If that’s the case, though, you could use a similar approach (i.e. surrogate-stack traversal) against the NSTreeController (or whatever else) you’re binding to.
HTH