Right now I have added seconds and min. in my timer. Additionally I need to add Hours month and year in my timer like below image:
Here is the code which I have implemented :
// CountDown Timer
In My view DidLoad I have initialized my variables:
currHour = 1;
currMinute= 3;
currSeconds= 00;
-(void)start {
timer=[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timerFired) userInfo:nil repeats:YES];
}
-(void)timerFired {
if((currHour>0 || currHour>=0) && (currMinute>0 || currSeconds>=0) && currMinute>=0) {
if(currSeconds==0) {
currMinute-=1;
currSeconds=59;
}
else if(currSeconds>0) {
currSeconds-=1;
}
if(currMinute>-1)
[self.progress setText:[NSString stringWithFormat:@"%d%@%02d %@",currMinute,@":",currSeconds,@"Sec"]];
}
else {
self.countDownView.hidden = TRUE;
[timer invalidate];
}
}
It's working till Minutes and seconds.
Thanks in advance.

Add to viewDidLoad next code and save target date as property or ivar
then add method for convert target date to seconds, e.g. in your example is 1 hour 3 min
then use next
timeFiredmethod: