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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to