Re: Responder chain vs find panel
Re: Responder chain vs find panel
- Subject: Re: Responder chain vs find panel
- From: Paul Collins <email@hidden>
- Date: Sat, 9 Dec 2006 16:45:17 -0800
On Dec 6, 2006, at 7:37 PM, Sean Murphy wrote:
On Dec 4, 2006, at 10:42 PM, Paul Collins wrote:
When the Find panel is opened, all the Find submenu items are
disabled, and I can't find which object, if any, is receiving -
validateMenuItem messages for the items. I suspect it's the
NSTextView in my
My document no longer gets them, nor does my find panel
controller, or even a diagnostic subclass of the find panel
(NSPanel).
Hi Paul,
-validateMenuItem is not sent if no object in the responder chain
implements the action message in the first place. So, for some
reason, when the find panel is open and its text field is the
panel's firstResponder, the chain is broken and nothing along it
seems to implement performFindPanelAction.
There's also another issue I found which might even be to blame for
the original problem. Try this: make one of your document windows
key and tab out of the NSTableView and focus one of the buttons
(make sure full keyboard access is enabled - hit ^F7). Now, open
up the find panel and initiate a search. This causes the following
exception to be raised:
2006-12-06 22:12:12.315 FindPanel[4835] Exception raised during
posting of notification. Ignored. exception: *** -[NSButton
delegate]: selector not recognized [self = 0x37c770]
So, I'd re-check the way in which the find panel works for your
application. Also, when using a delegate, it's best to ensure the
object can deal with the method you're sending to it, instead of
simply verifying that the delegate exists:
Sean, thanks for the info! I did need to fix that delegate test.
Mainly, the solution was to *not* use the Cocoa-defined method name -
performFindPanelAction. Apparently the find panel's NSTextView was
taking responsibility for validating this action, such that my own
objects never got a chance to. Simply using a different action name
in the delegates and the find submenu items allowed validation to
work as desired.
Thanks again.
--Paul Collins
_______________________________________________
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