how to make timer counter zero in this particular code when I click on the reset button the values must go to 00:00:00 and when i click on start button timer should be start from starting please help out
code here this in the .h file code
-(void)start
{
timer1 = [NSTimer scheduledTimerWithTimeInterval:(.01) target:self selector:@selector(timepassed) userInfo:nil repeats:YES];
}
this is in the .m file
-(void)timepassed
{
counter++;
if (counter == 60) { sec++; counter = 0; }
if (sec == 60) { min++; sec = 0; }
if (min == 60) { hr++; min = 0; }
NSString *l=[NSString stringWithFormat:@"%i:%i:%i",hr,min,sec];
[m setText:l];
}