• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Interface item validation through first responder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interface item validation through first responder


  • Subject: Re: Interface item validation through first responder
  • From: Luc Van Bogaert <email@hidden>
  • Date: Wed, 15 Jun 2011 21:12:11 +0200

On 15 Jun 2011, at 19:25, Quincey Morris wrote:

> On Jun 15, 2011, at 08:56, Luc Van Bogaert wrote:
>
>> I'm not sure I understand how to accomplish this. What I have already tried, is message the window with "makeFirstResponder:" passing my view controllers as a parameter. This initially seemed to work fine; until I add an extra view with some textfields to the content pane. Now, it appears that my validation method does not get called anymore, leading me to the conclusion that somehow my view controllers are no longer part of the responder chain.
>>
>> I used NSLog to find out the kind of object that is my window's "first responder" and "next responder"; but the last method returns nil, which I don't understand.
>
> I think there's still a small confusion here. For each window, there's a tree structure of NSResponder objects with the window at the root and the views as intermediate and leaf nodes. The nodes of this tree are linked (uni-directionally) by the "nextResponder" property.
>

Thanks for your help with this. It's very much appreciated.
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.


_______________________________________________

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

  • Follow-Ups:
    • Re: Interface item validation through first responder
      • From: Quincey Morris <email@hidden>
    • Re: Interface item validation through first responder
      • From: Kyle Sluder <email@hidden>
References: 
 >Interface item validation through first responder (From: Luc Van Bogaert <email@hidden>)
 >Re: Interface item validation through first responder (From: Quincey Morris <email@hidden>)
 >Re: Interface item validation through first responder (From: Luc Van Bogaert <email@hidden>)
 >Re: Interface item validation through first responder (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: After Autoreleasing Still Getting Leaked
  • Next by Date: Re: After Autoreleasing Still Getting Leaked
  • Previous by thread: Re: Interface item validation through first responder
  • Next by thread: Re: Interface item validation through first responder
  • Index(es):
    • Date
    • Thread