#import"ShowTimeViewController.h"@interface Showtimeviewcontroller () @property (weak, nonatomic) Iboutlet UIButton*Btnbigen, @property (weak, nonatomic) Iboutlet UILabel*lbshowtime; @property (nonatomic) BOOL isrunning; @property (strong, strong) Nstimer*Curtimer, @property (nonatomic)intcurint, @end @implementation showtimeviewcontroller-(ibaction) Clickbegin: (ID) Sender {if(self.isrunning) {//Pause[Self.curtimer invalidate]; Self.isrunning=NO; [Self.btnbigen settitle:@"Start"Forstate:uicontrolstatenormal]; }Else { //Runself.isrunning=YES; Self.curtimer= [Nstimer scheduledtimerwithtimeinterval:0.001target:self selector: @selector (updatetime) Userinfo:nil Repeats:yes]; [Self.btnbigen settitle:@"Pause"Forstate:uicontrolstatenormal]; }}-(void) updatetime{Self.curint++ ; intTime =Self.curint; intmin = time/( +* - ) ; intSecond = (Time-min * +* -) / + ; intms = Time-min * +* --Second * + ; Self.lbShowTime.text= [NSString stringWithFormat:@"%02d:%02d%03d", Min, second, Ms];}-(ibaction) Clickreset: (ID) Sender {//Reset[Self.curtimer invalidate]; Self.isrunning=NO; Self.lbShowTime.text=@"00:00" ; [Self.btnbigen settitle:@"Start"forstate:uicontrolstatenormal];}- (void) viewdidload {[Super viewdidload]; //Do any additional setup after loading the view.}- (void) didreceivememorywarning {[Super didreceivememorywarning]; //Dispose of any resources the can be recreated.}
Do something, just upload it.