I use the "Next" value for the "Return Key" to get the Next button in place of the Done button, but (obviously) pressing it doesn't automatically move to the next UITextField in my view.
What's the right way to do this? On a larger topic, what are some tips for properly building forms in the iPhone SDK?
resignFirstResponder()Notifies this object that it has been asked to relinquish its status as first responder in its window.
Make some object the first text field's delegate, and implement the - (BOOL)textFieldShouldReturn:(UITextField *)textField
method; in that, call the second text field's -becomeFirstResponder
. Returning YES
from that will make the text field perform its default behavior for the return button – I think that's generally sending its action message. If you don't have anything added as a target of that action, it doesn't really matter what you return.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With