Вы можете переместить фокус на определенное UITextField, вызвав:
[myTextField becomeFirstResponder]
Если вы реализуете UITextFieldDelegate в своем классе, объявив следующий метод, вы можете обрабатывать нажатие клавиши «Готово» на клавиатуре, которая является собственным приложением iPhone, эквивалентным нажатию клавиши tab.
/*****************************************************************************/
/* Handle the Done button being pressed on the keyboard for any of our */
/* editable UITextFields. We either pass the keyboard focus to the next */
/* text field, or we hide the keyboard. */
/*****************************************************************************/
- (BOOL)textFieldShouldReturn:(UITextField *)xiTextField
{
if (xiTextField == myAccountNameTextField])
{
NSLog(@"Done pressed whilst in account name field, pass focus");
[myPasswordTextField becomeFirstResponder];
}
else
{
NSLog(@"No next text field, closing keyboard");
[xiTextField resignFirstResponder];
}
}