• 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: 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


References: 
 >NSOutlineView - Automatically select newly added item - Help needed (From: Mario Kušnjer <email@hidden>)
 >Re: NSOutlineView - Automatically select newly added item - Help needed (From: Colin Howarth <email@hidden>)

  • Prev by Date: Re: Checking whether a file is a genuine PDF file
  • Next by Date: Re: wait for the event?
  • 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