In the viewdidload method, I’ve assigned one of my text fields as first responder by the following way.
[txtUsername becomeFirstResponder];
When the view gets loaded, the text field becomes active and a keyboard appears. But when I tried typing on the keyboard, it is not responding. However when I touched the text field, the keyboard is responding properly. I don’t know what is wrong with this. can anyone give me a suggestion?
Thanks in Advance – Abilash
Calling
becomeFirstResponderinviewDidLoadis not a good idea because the view might not even be on the screen and part of the view hierarchy yet.Try calling
becomeFirstResponderinviewDidAppear:instead: