开发者

Countdown timer for iphone [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit开发者_如何学Go the help center. Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜