Re: another responder chain docs bug (validateUserInterfaceItem:)
Re: another responder chain docs bug (validateUserInterfaceItem:)
- Subject: Re: another responder chain docs bug (validateUserInterfaceItem:)
- From: Jens Miltner <email@hidden>
- Date: Wed, 03 Feb 2010 10:02:50 +0100
Am 26.01.2010 um 00:31 schrieb Andy Lee:
Semi-related to my previous post, I just filed rdar://7577360 (text
below). As far as I can tell, it's a bug in the docs.
--Andy
The "Overview" at <http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSUserInterfaceValidations_Protocol/Reference/Reference.html
> says: "To validate a control, the application calls
validateUserInterfaceItem: for each item in the responder chain,
starting with the first responder. If no responder returns YES, the
item is disabled."
From my experience, this is not what happens. Rather, it works the
way Jakob Olesen describes in this post on cocoa-dev:
<http://www.cocoabuilder.com/archive/cocoa/168662-validateuserinterfaceitem-and-chaining-actions.html
>
"1. Find the target for my action
2. Validate using that target and nobody else."
I.e., validateUserInterfaceItem: does not go up the responder chain
until it gets a YES answer; it goes up the responder chain until it
finds a target that responds to the action message, meaning the docs
are incorrect.
Well, in my experience the truth is somewhere between the two:
AppKit seems to go up the responder chain and call
validateUserInterfaceItem: on each potential target (i.e. each
responder that responds to the action message and responds to
validateUserInterfaceItem:) until the first call to
validateUserInterfaceItem: returns YES.
If none of the potential targets returns YES from
validateUserInterfaceItem:, the item is disabled.
</jum>
_______________________________________________
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