Responder-Chain question.
Responder-Chain question.
- Subject: Responder-Chain question.
- From: Motti Shneor <email@hidden>
- Date: Tue, 13 Sep 2011 15:01:31 +0300
Hello everyone.
I need to insert some controllers I have into the responder chain, in such a place that their functionality (IBActions and menu validation) will be available regardless of specific view focus, etc.
Event Programming guide says:
"You should never send setNextResponder: to an NSView object. You can safely add responders to the top end of a window’s responder chain—the NSWindow object itself if it has no delegate or, if it has a delegate, after the delegate.
However --- the window delegate isn't an NSResponder to start with, and is only being delegated responder methods from the window --- it is never in the responder chain per se. (same goes for the App delegate).
I have two questions:
1. Is it a typo, and the doc really means "windowController" instead of "delegate" ?? this makes much more sense.
2. If I have two windows, and each of them has such a custom controller inserted into its responder chain after the windowController (or delegate?). What happens when I bring them to front in turn (user clicks on each). Somewhere Appkit re-wires the responder chain, and connects the window to the application --- won't my controller be dropped out of the responder chain then?
Thanks.
Motti Shneor
Senior software engineer and team leader
Spectrum Reflections Ltd.
-- ceterum censeo microsoftiem delendam esse ---
_______________________________________________
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