Re: First Responder
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