How can I select the root node (aka the 'content' property) of an
NSTreeController?
I've created an NSTreeController and set its content property as an empty
NSTreeNode. Now I want to select the content node, and add more NSTreeNode
children to it.
NSTreeController *root = [[NSTreeController alloc]
initWithContent:[NSTreeNode new]];
root.selectionIndexPath = [NSIndexPath indexPathWithIndex:0];
// The selected nodes array always shows up as empty :(
NSLog(@"child nodes of root: %@", root.selectedNodes);
Why does this fail? The selectedNodes property always shows up as empty
even if I select it with [NSIndexPath indexPathWithIndex:0]. Is the root
node not selectable? If not, how do I add children to it?
No comments:
Post a Comment