• 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 - Automatically select newly added item - Help needed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView - Automatically select newly added item - Help needed


  • Subject: Re: NSOutlineView - Automatically select newly added item - Help needed
  • From: Graham Cox <email@hidden>
  • Date: Tue, 6 Oct 2009 12:24:44 +1100


On 06/10/2009, at 10:44 AM, Mario Kušnjer wrote:

[sourceListLevelZero addObject:[Parent new]];

[lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex: [lsOutlineView rowForItem:[Parent new]]] byExtendingSelection:NO];


Assuming -addObject: in the first line adds the object to the end of the array, just do this:


[lsOutlineView selectRowIndexes:[NSIndexSet indexSetWithIndex: [sourceListLevelZero count] - 1] byExtendingSelection:NO];



This generalises to any position - just find the index of the object you just added.


--Graham


_______________________________________________

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 - Automatically select newly added item - Help needed (From: Mario Kušnjer <email@hidden>)

  • Prev by Date: Re: NSOutlineView - Automatically select newly added item - Help needed
  • Next by Date: Re: Checking whether a file is a genuine PDF file
  • Previous by thread: Re: NSOutlineView - Automatically select newly added item - Help needed
  • Next by thread: Re: NSOutlineView - Automatically select newly added item - Help needed
  • Index(es):
    • Date
    • Thread