Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-[UITextField isFirstResponder] returns false even though field is currently editing

In my view controller's -viewDidLoad method, I call [myTextField becomeFirstResponder]; This works like a charm, opens the keyboard and myTextField gets focus.

I have a button with a target action (the action is in the same controller) that checks [myTextField isFirstReponder] - but it always returns false (er, NO in Cocoa terms ;)).

Is that not the right way to find out if myTextField has the keyboard up for input?

like image 545
RickDT Avatar asked Oct 30 '08 11:10

RickDT


1 Answers

What about checking the value of the editing property, ie [myTextField isEditing]?

I think your button takes over first responder status when you tap it.

like image 97
Jablair Avatar answered Sep 18 '22 18:09

Jablair