timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerFireMethod:) userInfo:nil repeats:YES];
// Countdown method: the verification code is countdown to 60 seconds. After 60 seconds, the button changes and starts to look like-(void) timerfiremethod :( nstmer *) thetimer {If (seconds = 1) {[thetimer invalidate]; seconds = 60; [validcodebtn _ settitle: @ "get verification code" forstate: uicontrolstatenormal]; [validcodebtn _ settitlecolor: [uicolor blackcolor] forstate: uicontrolstatenormal [validcodebtn _ setenabled: Yes];} else {seconds --; nsstring * Title = [nsstring stringwithformat: seconds, seconds]; [validcodebtn _ settitlecolor: [uicolor graycolor] forstate: uicontrolstatenormal]; [validcodebtn _ setenabled: No]; [validcodebtn _ settitle: Title forstate: uicontrolstatenormal] ;}// if the login succeeds, stop the reciprocal of the verification code.-(void) releasetimer {If (timer) {If ([Timer respondstoselector: @ selector (isvalid)]) {If ([Timer isvalid]) {[Timer invalidate]; seconds = 60 ;}}}}