I have the following code for two text fields. The idea is that when you click the Next button on the first field it will move the cursor to the second field.
Code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if( textField == firstField )
{
// Move selection to next field
[self.firstField endEditing:YES];
[self.secondField becomeFirstResponder];
}
}
All of this works as expected. However, I have recently noticed that when it switches to the second field, the keybord type changes away from what I have setup in the .xib. It works correctly when I click directly on the second field. So, I figured if I added the code below I could force the keyboard type. Unfortunately, this does not work either.
Code:
- (BOOL)textFieldDidBeginEditing:(UITextField *)textField
{
[textField setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
return YES;
}
Any ideas would be apreciated.
-Jerry