--%ld---",[d second]);
if([d second] < 60 && [d second] > 0) {
NSString *miao = [NSString stringWithFormat:@"%ld",[d second]];
NSLog(@"---miao----%@",miao);
UIButton *sendYZM=[UIButton buttonWithType:UIButtonTypeCustom];
[sendYZM setFrame:CGRectMake(50, 100, 250, 50)];
[sendYZM setBackgroundColor:[UIColor redColor]];
[sendYZM setTitle:[NSString stringWithFormat:@"重新发送验证码(%@秒)",miao] forState:UIControlStateNormal];
[sendYZM setTitleColor:[UIColor colorWithRed:66/255.0 green:66/255.0 blue:221/255.0 alpha:1.0] forState:UIControlStateNormal];
[self.view addSubview:sendYZM];
}else if([d second] == 0) {
[sysTimer invalidate];
UIButton *sendYZM=[UIButton buttonWithType:UIButtonTypeCustom];
[sendYZM setFrame:CGRectMake(50, 100, 250, 50)];
[sendYZM setBackgroundColor:[UIColor redColor]];
[sendYZM setTitle:@"重新发送验证码" forState:UIControlStateNormal];
[sendYZM setTitleColor:[UIColor colorWithRed:66/255.0 green:66/255.0 blue:221/255.0 alpha:1.0] forState:UIControlStateNormal];
[sendYZM addTarget:self action:@selector(doClickButton:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:sendYZM];
}
}
- (void)getAuthCode{
//将电话号码发送到服务器,服务器返回验证码。当验证码和注册用户输入一样的时候,则可以进行下一步操作。
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
|