Countdown timer for iphone [closed]
I would like to design a countdown timer with 55 mins time limit. And i would also like to start and stop it according to the necessity.
You can use a scheduled timer which calls a function on completion. Here I have used done waiting method.
[NSTimer scheduledTimerWithTimeInterval:(55.0f * 60.0f) target:self selector:@selector(doneWaiting:) userInfo:nil repeats:NO];
- (void) doneWaiting:(NSTimer *)theTimer {
//perform code after timer expires here
}
Will the app be open for the full 55 mins? You can use [object performSelector withDelay..]
if it will. Else you might find UILocalNotification useful
精彩评论