I have three text fields and I want to be able to move the cursor to the next one. When the last one is reached, the keyboard dismisses. But nothing works for me... Here's an example of what I have. However, nothing moves, and nothing happens when I select the next button.

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

3

Are you sure the text field delegates are set correctly? Does this method get called at all?
–
stevexApr 6 '13 at 0:25

Sounds like you are looking for a way to have Prev/Next/Done buttons over the keyboard so that the user can navigate from field to field and the app can auto-navigate from field to field. I had good luck making use of some code on github: github.com/simonbs/BSKeyboardControls
–
Rick TrappApr 6 '13 at 0:27

Does this method get called? If it does .. and the textField == field1TextField block is called .. and field2TextField is not nil .. then it looks like it should work
–
stevexApr 6 '13 at 0:31

Form your comment as a question! i forgot to do that! i will check mark it!
–
Kyle GreenlawApr 6 '13 at 0:32

1 Answer
1

The object that this method is bound to should be set as the text field's delegate. Check this by setting a breakpoint in the method to verify that it is called when you think it is.

If you are using nibs or storyboards, the field... instance variables should be outlets that are correctly hooked up. If they are created programmatically, you should ensure that they have objects assigned to them. Verify this by inspecting the values of these variables when you are inside the method.

You don't have to call resignFirstResponder on other controls before calling becomeFirstResponder on another.