• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSOutlineView - how to have a default item selected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView - how to have a default item selected


  • Subject: Re: NSOutlineView - how to have a default item selected
  • From: Boyd Collier <email@hidden>
  • Date: Fri, 27 Nov 2009 11:48:58 -0800

Dave,

Itai Ferber also suggested this fix, and previously I had tried it to no avail. However, the problem turned out to be where I put these lines (and a couple of others) in my code. After much fiddling, I finally got things right! Thanks for taking time to post the suggestion.

Boyd


On Nov 25, 2009, at 3:53 PM, Dave DeLong wrote:

How about this?

NSInteger index = [myOutlineView rowForItem:itemToSelect];
NSIndexSet * indexSet = [NSIndexSet indexSetWithIndex:index];
[myOutlineView selectRowIndexes:indexSet byExtendingSelection:NO];

HTH,

Dave

On Nov 25, 2009, at 4:48 PM, Boyd Collier wrote:

Mario KuĆĄnjer's question reminded me of a question that I've been pondering about NSOutlineViews, namely, is there a way to have one item on the outline initialized in the selected state when the outline is first created? That is, when the window containing the outline is first displayed to the user, what I would like is for the first item in my outline to already show as selected. Seems like there should be a simple way of doing this, but if so, I've not yet discovered it. I have a small test project based on code that Itai Ferber was kind enough to send me, and I would be more than happy to make it available to anyone who would be interested in looking at it.

Boyd
_______________________________________________

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

_______________________________________________

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


References: 
 >NSOutlineView - how to have a default item selected (From: Boyd Collier <email@hidden>)
 >Re: NSOutlineView - how to have a default item selected (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: My try/catch block isn't catching exceptions on 10.6
  • Next by Date: Re: Core Data and +[NSExpression expressionForFunction:...]
  • Previous by thread: Re: NSOutlineView - how to have a default item selected
  • Next by thread: Core Data and +[NSExpression expressionForFunction:...]
  • Index(es):
    • Date
    • Thread