Re: Interface item validation through first responder
Re: Interface item validation through first responder
- Subject: Re: Interface item validation through first responder
- From: Quincey Morris <email@hidden>
- Date: Wed, 15 Jun 2011 12:49:36 -0700
On Jun 15, 2011, at 12:12, Luc Van Bogaert wrote:
> Because things still don't work, I have tried to visualize the responder chain by adding this into applicationDidFinishLaunching:
>
> NSResponder *nextResponder = [self.window nextResponder];
> do {
> NSLog(@"%@", [nextResponder class]);
> nextResponder = [nextResponder nextResponder];
> } while (nextResponder);
>
> This just returns one line of output: "null"
>
> So does this mean my window doesn't have a next responder? If so, I'm completely lost about why that would be. But of course that would explain why the validation methods are never called.
It sounds like you're thinking of the chain as running "down" from the window to its subviews (and, potentially, the subview view controllers). It actually runs in the other direction, "up" from window.firstResponder towards the window object, and *ends* at the window. (I mean, the window-specific responder tree ends there. The logical responder chain continues on to the window controller, etc, just not using nextResponder links.)
If you want to see what (part of) the chain looks like, start your loop from window.firstResponder.
_______________________________________________
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