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

Re: First Responder


  • Subject: Re: First Responder
  • From: Graham Cox <email@hidden>
  • Date: Sat, 26 Feb 2011 17:03:44 +1100

On 26/02/2011, at 4:31 PM, koko wrote:

> I connect a menu item to an action in first responder. The action is defined in a .h and .m in the project
>
> In applicationDidFinishLaunching I alloc, init and retain an object that contains the action connected to the menu item in first responder.
>
> At run time the menu item is not enabled.  I don't get it.


If the object isn't in the responder chain, it can't respond. If it's not a subclass of NSResponder, it can't be in the responder chain.

The application delegate itself is in the responder chain (on behalf of NSApplication), so this is where the action should be implemented (even if it just passes it on to the helper object). If something in the responder chain can respond to the action, the menu item will be automatically enabled.


--Graham


_______________________________________________

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: 
 >First Responder (From: koko <email@hidden>)

  • Prev by Date: Re: First Responder
  • Next by Date: Re: First Responder
  • Previous by thread: Re: First Responder
  • Next by thread: Re: First Responder
  • Index(es):
    • Date
    • Thread