开发者

How to fire an alarm after 2 seconds on iPhone

开发者 https://www.devze.com 2023-01-10 02:00 出处:网络
I want to fire an alarm that will ring after 2 secs. How to开发者_高级运维 handle alarm code. Any help?

I want to fire an alarm that will ring after 2 secs. How to开发者_高级运维 handle alarm code. Any help?

Thanks


You should look into the NSTimer class


It really depends what do you mean by an alarm...

If you want a popup alert after a while, you can use Local Notification, which is an iOS 4 feature. An example can be found here.

If you need certain function to be invoked by a timer, try NSTimer. Here is an example.

0

精彩评论

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