On Feb 18, 2009, at 10:59 AM, Tomas Franzén wrote:

Hi,

I'm transitioning my app from using a NSOutlineView data source to NSTreeController. I want to start editing a row programmatically, so I need to call editColumn:row:withEvent:select:, but then I need the row index. I can get that with rowForItem:, but as far as the NSOutlineView is concerned, it deals with NSTreeNodes. So I need a way to get the NSTreeNode for a given object.

+ treeNodeWithRepresentedObject: doesn't help since it creates a new node.

This seems like something that should be easy, but I can't figure it out.

AFAIK, there's no way to do this other than employing somewhat ugly and inefficient hacks such as iterating through the entire tree structure looking for the node whose represented object is the object you're looking for.

In my opinion, NSTreeController is still limited enough that it raises some questions about whether it really should be used.

Charles_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to