Re: makeFirstResponder returns NO
Re: makeFirstResponder returns NO
- Subject: Re: makeFirstResponder returns NO
- From: "Adam Gerson" <email@hidden>
- Date: Wed, 20 Feb 2008 00:38:22 -0500
>
> > - (IBAction)addServerButtonAction:sender {
> > [serverArrayController add:self];
> > [window makeFirstResponder:protocolTextField];
> > }
>
> From the NSArrayController class reference for add:
>
> > Special Considerations
> > Beginning with Mac OS X v10.4 the result of this method is deferred
> > until the next iteration of the runloop so that the error
> > presentation mechanism can provide feedback as a sheet.
> >
>
> Presumably your text field won't accept first responder status (or
> perhaps isn't enabled) until there's something in the array controller
> for it to bind to, but that doesn't happen until some time after your
> action method.
Interesting. Thanks. That does explain whats going on. Well, this may be
ugly, but I solved my problem by inserting an non repeating NSTimer to kick
off after I call add: then 0.1 seconds latter it calls makeFirstResponder.
It works!
Adam
_______________________________________________
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