{
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(Timing) userInfo:nil repeats:YES];
num = 60;
[timer fire];
}
- (void)Timing{
num--;
[timeBtn setTitle:[NSString stringWithFormat:@"%d",num] forState:UIControlStateNormal];
if (num == 0) {
[timer invalidate];
timer = nil;
[timeBtn setTitle:@"重新发送" forState:UIControlStateNormal];
[forgetView.loginVerificationCodeBtn setEnabled:YES];
}else{
[forgetView.loginVerificationCodeBtn setEnabled:NO];
}
}
网友评论