Re: accessing values along NSIndexPath
Re: accessing values along NSIndexPath
- Subject: Re: accessing values along NSIndexPath
- From: "Gary L. Wade" <email@hidden>
- Date: Wed, 26 Mar 2014 13:35:20 -0700
- Thread-topic: accessing values along NSIndexPath
If all you have is a nested set of arrays, then you¹ll have to write your
own objectAtIndexPath: method that walks your nested set of arrays.
--
Gary L. Wade
http://www.garywade.com/
On 3/26/2014, 1:14 PM, "Torsten Curdt" <email@hidden> wrote:
>Going through a NSTreeController feels like cracking a nut with a
>sledge-hammer.
>Then I would rather roll my own.
>
>There is really no other way?
>
>On Wed, Mar 26, 2014 at 8:56 PM, Lee Ann Rucker <email@hidden>
>wrote:
>> 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 (email@hidden)
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:
This email sent to email@hidden