I have a terrible time trying to implement the task, when the user selects the "next" button on the keyboard, the user then goes to the next text field to start editing. In my example, I have three text fields. This is what I have done, I hope you can fill me with where I am wrong. Keep in mind that I just took the SDK a few weeks ago so this could be part of the problem :)
In my ViewControler.h file, I created the following method
-(IBAction)nextPressed:(id) sender;
In my ViewController.m file, I created the following action
-(IBAction)nextPressed:(id) sender { if ([txtUserName isFirstResponder]) { [txtUserName2 becomeFirstResponder]; } if ([txtUserName2 isFirstResponder]) { [txtUserName3 becomeFirstResponder]; } }
In my .xib file, I linked the first text box (by right-clicking on the text box and dragging it to the “File Owner” and selecting “nextPressed: Events” in the Events section) to my file owner. I tried to associate only with the first text field, and when it did not work in all three text fields. I also tried to associate not with the file owner, but with the first responder for one text field, and then with all the text fields, with no luck. In addition, for each text field, I selected Return Key as "NEXT".
Now, when I create / run, I can edit the text field and see the “next” button in the lower right corner, however it does not transfer me to the next field.
What step am I doing wrong here? I used the instructions from this post ( How do you change UIControl with a focus on the iPhone? ), But there seems to be something huge missing.
Any help with this would be greatly appreciated. I have looked at this for the past four hours, and Googling I can come up with all the possible search conditions and cannot easily wrap my head around the steps necessary to achieve this. Again, and help will be very helpful :)