Re: NSOutlineView - Automatically select newly added item - Help needed
Re: NSOutlineView - Automatically select newly added item - Help needed
- Subject: Re: NSOutlineView - Automatically select newly added item - Help needed
- From: Graham Cox <email@hidden>
- Date: Tue, 6 Oct 2009 12:24:44 +1100
On 06/10/2009, at 10:44 AM, Mario Kušnjer wrote:
[sourceListLevelZero addObject:[Parent new]];
[lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:
[lsOutlineView rowForItem:[Parent new]]] byExtendingSelection:NO];
Assuming -addObject: in the first line adds the object to the end of
the array, just do this:
[lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:
[sourceListLevelZero count] - 1] byExtendingSelection:NO];
This generalises to any position - just find the index of the object
you just added.
--Graham
_______________________________________________
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