I have two UITextfields as follows,
If the user enter 4 digits in the first textfield, then the second textfield should becomesfirstresponder. I have tried below code,
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
int num = [textField.text length] - range.length;
if(textField==pin && num ==4)
{
[cpin becomeFirstResponder];
}
}
This works like, the user has to enter the fifth digit. I want the second textfield to becomes responder after entering four digits in the first UITextfield. How to do that?