objective c - NSTreeController: how do I find the parent of a node? -
i'm looking similar method to: nsoutlineview
parentforitem:
nstreecontroller.
i need know parent of node in tree.
nodes in nstreecontroller
instances of nstreenode
, , nstreenode
has read-only parentnode
property - use that.
the short snippet below gets parent node of first node in tree-controller's selectednodes
array:
let selectednode = tree.selectednodes.first! as! nstreenode let parentofselectednode = selectednode.parentnode!
Comments
Post a Comment