• 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 doesn't call outlineView:shouldSelectItem: after selectRowIndexes:byExtendingSelection:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView doesn't call outlineView:shouldSelectItem: after selectRowIndexes:byExtendingSelection:


  • Subject: Re: NSOutlineView doesn't call outlineView:shouldSelectItem: after selectRowIndexes:byExtendingSelection:
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 14 Nov 2011 19:24:08 -0800

On Mon, Nov 14, 2011 at 6:18 AM, Motti Shneor <email@hidden> wrote:
> However, if we need to PROGRAMMATICALLY set the selection, using selectRowIndexes:byExtendingSelection: for example,  outlineView:shouldSelectItem: is never called.

>From "Selecting and Deselecting Rows Programmatically" in the Table
View Programming Guide:

> Note: It is important to note that when the row is changed programmatically the selectionShouldChangeInTableView: message is not sent to the delegate. This means that the application is responsible for ensuring the validity of the contents of the currently selected row if it is being edited.

http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TableView/RowSelection/RowSelection.html#//apple_ref/doc/uid/10000026i-CH6-SW6

The point is that you can make programmatic changes that the user
can't make with the mouse. The most common case is to disallow the
user from making any selection changes at all; only the program can
change the selection.

Just reuse whatever logic you've put into
-outlineView:shouldSelectItem:. If you want, factor out the validation
logic into its own method. If the conditions aren't met, either pass a
different set of row indexes to
-selectRowIndexes:byExtendingSelection: or just don't call that method
at all.

--Kyle Sluder
_______________________________________________

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: NSOutlineView doesn't call outlineView:shouldSelectItem: after selectRowIndexes:byExtendingSelection:
      • From: Motti Shneor <email@hidden>
References: 
 >NSOutlineView doesn't call outlineView:shouldSelectItem: after selectRowIndexes:byExtendingSelection: (From: Motti Shneor <email@hidden>)

  • Prev by Date: Please allow me to introduce myself ...
  • Next by Date: RE: Troubles with Bold and Italic fonts - Cocoa
  • Previous by thread: NSOutlineView doesn't call outlineView:shouldSelectItem: after selectRowIndexes:byExtendingSelection:
  • Next by thread: Re: NSOutlineView doesn't call outlineView:shouldSelectItem: after selectRowIndexes:byExtendingSelection:
  • Index(es):
    • Date
    • Thread