|
@@ -116,11 +116,13 @@
|
|
|
#pragma mark UITextFieldDelegate
|
|
|
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
|
|
|
{
|
|
|
-// 获取短信中提取的验证码,自动输入到输入框中
|
|
|
if(string.length > 1){
|
|
|
for (int i = 0 ; i < self.tfArr.count; i++) {
|
|
|
AuthCodeTextField *tf = self.tfArr[i];
|
|
|
- tf.text = [string substringWithRange:NSMakeRange(i, 1)];
|
|
|
+ if(string.length >= i+1)
|
|
|
+ {
|
|
|
+ tf.text = [string substringWithRange:NSMakeRange(i, 1)];
|
|
|
+ }
|
|
|
}
|
|
|
return NO;
|
|
|
}
|