tags:

views:

55

answers:

2

i want to fire a alarm that will ring after 2 secs ,how ti handle alarm code any help?

Thanks

+1  A: 

You should look into the NSTimer class

ChinaPaul
thanks but what timer do?? i mean i want exactly like alram or can i open iphone clock form my application ?? or just play a sound but i still want my alarm to be active even if user quits app. lets say he fixed a alarm after 5 mins so even if he close the app alarm will ring after 5 min
ram
If you just need an action to be triggered by the application 2 seconds after the app launches then you should use NSTimer. But after your comment it sounds like you need to use Local Notification so that the alarm is triggered by the OS even if the application isn't running.http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html
ChinaPaul
A: 

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.

ohho
thanks a lot :-)
ram