• 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: TableView Event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TableView Event


  • Subject: Re: TableView Event
  • From: Sherm Pendley <email@hidden>
  • Date: Mon, 16 Apr 2007 18:57:03 -0400

On Apr 16, 2007, at 6:35 PM, hac wrote:

I have an NSTableView that I want to trigger an action when the selected row
is changed. I have no idea how to do this as I've only used event handling
where I can directly connect the objects in Interface Builder. Thanks. :)

In general, you should make a habit of looking in the "Delegate Methods by Task" and "Notifications" sections of the docs for the class you're using. Both delegation and notification are core Cocoa design patterns, so it pays to get used to them.


In this case, you have two options: You can implement - tableViewSelectionDidChange: in your delegate. Or, you can register to receive NSTableViewSelectionDidChangeNotification notifications from your table view.

For more on delegation and notifications, have a look at:

<file:///Developer/ADC Reference Library/documentation/Cocoa/ Conceptual/CocoaFundamentals/CommunicatingWithObjects/ chapter_6_section_4.html>
<file:///Developer/ADC Reference Library/documentation/Cocoa/ Conceptual/Notifications/index.html>


Or online:

<http://developer.apple.com/documentation/Cocoa/Conceptual/ CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_4.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ Notifications/index.html>


sherm--

Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: TableView Event
      • From: mmalc crawford <email@hidden>
References: 
 >TableView Event (From: hac <email@hidden>)

  • Prev by Date: Re: TableView Event
  • Next by Date: Re: TableView Event
  • Previous by thread: Re: TableView Event
  • Next by thread: Re: TableView Event
  • Index(es):
    • Date
    • Thread