1
votes

Maybe this is a silly question, but I can't find the right method in the documentation.

How do I find the object of a NSTreeController given its NSIndexPath?

Something like: objectAtIndexPath: is not available?

1

1 Answers

1
votes

You don't ask the controller directly. First you get the controller's arrangedObjects, which will be an NSTreeNode or a subclass.

NSTreeNode has descendantNodeAtIndexPath:, also returning a tree node object. That node's representedObject is probably what you're looking for.