• 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
How to require contiguous selection in a table view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to require contiguous selection in a table view?


  • Subject: How to require contiguous selection in a table view?
  • From: Arthur C. <email@hidden>
  • Date: Mon, 6 Aug 2007 19:53:31 +0200
  • Importance: Normal

I want to have my table view allowing multiple selections, but only if the selection is contiguous.
This is needed because I want to have drag and drop operations inside the table view to reorder some properties.
I think there should be a simple boolean 'setRequiresContiguousSelection' or something next to the 'allowsMultipleSelection'.

What I'm doing now is a bit more complicated. I'm using a custom array controller that I need for other purposes.
I listen to the NSTableViewSelectionDidChangeNotification, and then I check in the array controller which indexes are selected (it returns an NSIndexSet).
If it is discontiguous, I want to change the selection so that only the row that was last clicked (tried to add to the selection or tried to deselect) gets selected.

The question is how to do this - the 'selectedRow' operation from NSTableView gives only the row that was last added to the selection; the 'clickedRow' operation that I want does not seem to work; it returns -1. So, how should this be done?

Thanks for your time,

Arthur C.
_________________________________________________________________
With Windows Live Hotmail, you can personalize your inbox with your favorite color.
www.windowslive-hotmail.com/learnmore/personalize.html?locale=en-us&ocid=TXT_TAGLM_HMWL_reten_addcolor_0607_______________________________________________

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

  • Follow-Ups:
    • Re: How to require contiguous selection in a table view?
      • From: mmalc crawford <email@hidden>
    • Re: How to require contiguous selection in a table view?
      • From: "I. Savant" <email@hidden>
  • Prev by Date: NSIndexSet incomplete?
  • Next by Date: Re: How to require contiguous selection in a table view?
  • Previous by thread: Re: NSIndexSet incomplete?
  • Next by thread: Re: How to require contiguous selection in a table view?
  • Index(es):
    • Date
    • Thread