First you need a NSTreeController to manage your NSArray, then:

   NSTreeNode *topNode = [treeController arrangedObjects];
   return [topNode descendantNodeAtIndexPath:indexPath];


On Mar 26, 2014, at 12:02 PM, Torsten Curdt wrote:

> The Apple docs state:
> 
> "The NSIndexPath class represents the path to a specific node in a
> tree of nested array collections"
> 
> I can't find how to use the index path to access the tree though.
> It should be something along the lines of:
> 
>  NSIndexPath *indexPath = ...
>  NSArray *nestedArrays = ...
>  id obj = [nestedArrays objectByIndexPath:indexPath];
> 
> but I just cannot seem to find the right selector for this.
> 
> I could easily implement this myself - but there must be something
> like this already!? No?
> 
> cheers,
> Torsten
> _______________________________________________
> 
> 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:
> https://urldefense.proofpoint.com/v1/url?u=https://lists.apple.com/mailman/options/cocoa-dev/lrucker%2540vmware.com&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=yJFJhaNnTZDfFSSz1U9TSNMmxGyib3KjZGuKfIhHLxA%3D%0A&m=CXRx5m4gvxOtLBk%2FKvoQ8oAikjCpYgRgvp64DRbHvuI%3D%0A&s=9326e7b9181f48fbf3ff31e51a62abdb32ca57642e025ca6cdf8e8e255bd8286
> 
> This email sent to lruc...@vmware.com

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to