Browse Source

1.修复忘记密码闪退问题

huangxiaodong 1 year ago
parent
commit
7bc550686e

+ 4 - 2
创维盒子/双子星云手机/Class/Guide/AuthCodeView/AuthCodeInputView.m

@@ -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;
     }