Re: NSPathControl
Re: NSPathControl
- Subject: Re: NSPathControl
- From: Lee Ann Rucker <email@hidden>
- Date: Mon, 01 Jun 2015 23:27:12 +0000
- Thread-topic: NSPathControl
On Jun 1, 2015, at 2:39 PM, Quincey Morris <email@hidden<mailto:email@hidden>> wrote:
On Jun 1, 2015, at 13:59 , Lee Ann Rucker <email@hidden<mailto:email@hidden>> wrote:
Because I couldn’t possibly be the only person using that …
What does that dangling “because” refer to? I can’t make it out.
My previous comment where I said I was using it to show the “path” to the current NSTreeController selection. I create my own NSPathComponentCells by finding each treeNode between the root and the selection. The cell's representedObject is the NSTreeNode for that part of the “path” & the title/image comes from the [treeNode representedObject], and the IBAction uses [clickedPathComponentCell representedObject] to find it.
NSIndexPath *iterationPath = [[self.treeController selectionIndexPaths] firstObject];
NSMutableArray *pathComponentArray = [NSMutableArray array];
NSTreeNode *topNode = [self.treeController arrangedObjects];
while ([iterationPath length] > 0) {
NSTreeNode *treeNode = [topNode descendantNodeAtIndexPath:iterationPath];
[pathComponentArray insertObject:[self componentCellFromNode:treeNode]
atIndex:0];
iterationPath = [iterationPath indexPathByRemovingLastIndex];
}
[pathControl setPathComponentCells:pathComponentArray];
_______________________________________________
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