• 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: NSReponder chain and controllers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSReponder chain and controllers


  • Subject: Re: NSReponder chain and controllers
  • From: Adam Knight <email@hidden>
  • Date: Thu, 19 Jun 2008 14:05:04 -0500

Add your controllers to the responder chain when appropriate and then put the IBAction methods in the relevant controllers. If you duplicate methods (like delete: or cancel:) take care as to what order you add them into the chain because the first to respond wins (though it can always send it to its next responder if it doesn't make sense at the moment, like cancel: without an operation running).

Adam Knight
"Every man is guilty of all the good he didn't do."  -- Voltaire



On Jun 19, 2008, at 1:20 PM, Robert Douglas wrote:

My code is getting ugly so I suspect I'm doing something wrong. I'm trying to hook up menu items in my main menu to actions that I've defined in my controllers. I have a Core Data doc with a multiple master-detail view hierarchy, and for testing purposes have buttons connected to a wide variety of methods. The NSArrayController subclasses are not in the responder chain so I'm connecting the menu items to the first responder, catching the action messages in my document and then dispatch them to the correct controller. That translates into a lot of simple dispatch code. I could move all the intelligence to the document level but that strikes me as equally ugly. Any suggestions?

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: NSReponder chain and controllers
      • From: Cathy Shive <email@hidden>
References: 
 >NSReponder chain and controllers (From: Robert Douglas <email@hidden>)

  • Prev by Date: Re: Binding the enabled property of a NSMatrix instance to wether or not a multiple selection on a array controller is made.
  • Next by Date: Re: NSData text representation
  • Previous by thread: NSReponder chain and controllers
  • Next by thread: Re: NSReponder chain and controllers
  • Index(es):
    • Date
    • Thread