OutlineView please remember you selection
OutlineView please remember you selection
- Subject: OutlineView please remember you selection
- From: "Adam Gerson" <email@hidden>
- Date: Sun, 30 Mar 2008 03:13:15 -0400
I have an OutlineView bound to an NSTreeController. I would like to
set the selected row of the OutlineView at the applications launch to
the second row. It defaults to the first. I have tried many
combination of the code below to no avail. If I trigger the code from
a button it works just fine. Something happens at launch time to
override these commands. Sometimes at app launch it even chooses the
second row and then I see it switch back to the first row before my
eyes. I have tried this code in awakeFromNib and
applicationDidFinishLaunching.
NSError *error;
[treeController fetchWithRequest:nil merge:NO error:&error];
[treeController setSelectionIndexPath:[NSIndexPath indexPathWithIndex:1]];
[outlineView selectRow:1 byExtendingSelection:NO];
_______________________________________________
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