FROM : Benjamin Stiglitz
DATE : Tue Jan 08 21:39:36 2008
> 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_______________________________________________
Cocoa-dev mailing list (<email_removed>)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
DATE : Tue Jan 08 21:39:36 2008
> 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_______________________________________________
Cocoa-dev mailing list (<email_removed>)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Adam Thorsen | Dec 28, 18:25 | |
| Benjamin Stiglitz | Jan 8, 21:39 |






Cocoa mail archive

