• 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: Which row is selected.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView: Which row is selected.


  • Subject: Re: NSOutlineView: Which row is selected.
  • From: John Cebasek <email@hidden>
  • Date: Wed, 17 Sep 2008 20:39:00 -0400

Hi All:

I guess I didn't have all the required interfaces implemented. I missed numberOfRowsInTable:NSTableView.

John

On 16-Sep-08, at 7:24 PM, Corbin Dunn wrote:


On Sep 16, 2008, at 4:17 PM, John Cebasek wrote:

Hi Nick, et al:

Well, I did use [self selectedRow], in a previous version of the code. but that also returned -1. I don't think I'm doing anything 'weird', the view has a delegate and a datasource which are in the same class connected in the xib. The awakeFroNib message populates the list. There are currently two parents (expandable) and a bunch of children in each. Things are populated corrected. My selection change notification is firing, so why wouldn't that cause _lastRowSelected (in the NSTableView member of the NSOutlineView, which I am assuming (and we all know what assume means) is the member that contains the currently selected row) be changed to reflect the currently selected row.

Has to be something staring me in the face, but I can't see it...

John

-selectedRow is the right thing to use. Or -selectedRowIndexes, if you use multiple selection. Don't access the ivar, that is not right.


It is hard to say what is going wrong without seeing your code. We'd have to see:

1. Your delegate/datasource's relevant methods
2. Your NSOutlineView subclass.

corbin


_______________________________________________

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: Which row is selected. (From: John Cebasek <email@hidden>)
 >Re: NSOutlineView: Which row is selected. (From: Nick Zitzmann <email@hidden>)
 >Re: NSOutlineView: Which row is selected. (From: John Cebasek <email@hidden>)
 >Re: NSOutlineView: Which row is selected. (From: Corbin Dunn <email@hidden>)

  • Prev by Date: CATextLayer and attributed strings
  • Next by Date: Listening for changes in a table
  • Previous by thread: Re: NSOutlineView: Which row is selected.
  • Next by thread: Re: NSOutlineView: Which row is selected.
  • Index(es):
    • Date
    • Thread