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: Charles Srstka <email@hidden>
- Date: Mon, 5 Oct 2009 20:55:10 -0500
On Oct 5, 2009, at 7:49 PM, Colin Howarth wrote:
On 6 Oct, 2009, at 01:44, Mario Kušnjer wrote:
...
[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 !
without trying to understand what's happening, or supposed to, you
could also (in cases like this) try TEMPORARILY unravelling your
method calls. Like this:
Parent *parent = [Parent new];
int index = [lsOutlineView rowForItem: parent];
NSArray *indices = [NSIndexSet indexSetWithIndex: index];
[IsOutlineView selectRowIndexes: indices byExtendingSelection:NO];
<< where I don't know what the actual classes are >>
Then you can check these intermediate steps, to see they're doing
what you think they should.
Then you can wrap it all up again once you've fixed it, to save
screen space :-)
Note that if your NSOutlineView is using an NSTreeController rather
than a custom data source, rowForItem: still won't work.
Charles_______________________________________________
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