NSTreeController selectedObjects always returns top level object

  • I've got an NSBrowser bound to an NSTreeController, from which I'm
    trying to get the currently selected object.  When I call
    selectedNodes on the controller, the return value always seems to be
    the top level node, no matter which column the most deeply selected
    node happens to be under.  I would expect that the most deeply
    selected tree node would be returned.  What am I missing?

    Here is the binding set up (pardon my Nu):

            (@treeController bind:"contentArray" toObject:self
    withKeyPath:"remoteTree" options:nil)
            (@millerBrowser bind:"content" toObject:@treeController
    withKeyPath:"arrangedObjects" options:nil)
            (@millerBrowser bind:"contentValues" toObject:@treeController
    withKeyPath:"arrangedObjects.representedObject.description" options:nil)

    And here is how I'm calling selectedNodes:

    (@treeController selectedNodes)

    Thanks,
    -Adam
  • > I've got an NSBrowser bound to an NSTreeController, from which I'm
    > trying to get the currently selected object.  When I call
    > selectedNodes on the controller, the return value always seems to be
    > the top level node, no matter which column the most deeply selected
    > node happens to be under.  I would expect that the most deeply
    > selected tree node would be returned.  What am I missing?
    >
    > Here is the binding set up (pardon my Nu):
    >
    > (@treeController bind:"contentArray" toObject:self
    > withKeyPath:"remoteTree" options:nil)
    > (@millerBrowser bind:"content" toObject:@treeController
    > withKeyPath:"arrangedObjects" options:nil)
    > (@millerBrowser bind:"contentValues" toObject:@treeController
    > withKeyPath:"arrangedObjects.representedObject.description"
    > options:nil)
    >
    > And here is how I'm calling selectedNodes:
    >
    > (@treeController selectedNodes)

    You’ll need to bind your browser’s selection paths to the array
    controller as well:
    (@millerBrowser bind:"selectionIndexPaths" toObject:@treeController
    withKeyPath:"selectionIndexPaths" options:nil)

    -Ben
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today