NSOutlineView - Automatically select newly added item - Help needed
NSOutlineView - Automatically select newly added item - Help needed
- Subject: NSOutlineView - Automatically select newly added item - Help needed
- From: Mario Kušnjer <email@hidden>
- Date: Tue, 6 Oct 2009 01:44:53 +0200
Hello to the list !
Request for help regarding a little problem.
So I have this piece of code:
- (IBAction)addNewItem:(id)sender
{
if ([lsOutlineView selectedRow] < 0)
{
[sourceListLevelZero addObject:[Parent new]];
[lsOutlineView reloadItem:nil reloadChildren:YES];
[lsOutlineView expandItem:nil expandChildren:YES];
[lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:
[lsOutlineView rowForItem:[Parent new]]] byExtendingSelection:NO];
}
...
}
It is the last line that trouble's me.
It should select newly added item in the list (right ?), but it does
not !
Or am I doing something wrong (very likely !) ?
Ok, so you got it by now that I am trying to get the behavior that
when user clicks add button new item that appears in the list
automatically gets selected.
Thanks for help
Bye
Mario Kušnjer
email@hidden
+385957051982
mariokusnjer@skype
_______________________________________________
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