Alarm repeat in particular time interval - iphone

I know this question ask several time. Even i am trying this below code:
http://iphonesdkdev.blogspot.in/2010/04/local-push-notification-sample-code-os.html
Still I am not able to play alarm at particular time interval.
I have date-time picker. User select time from that date-time picker, which contain time from 1 min to 23 hours.
In my app alarm works but only one time. I need to play that alarm till user does not stop that timer switch from on to off.
Please Help me.
Any idea and suggestion is Appreciated!!!!

You can set RepeatInterval for your localNotification
[localNotification setRepeatInterval:NSMinuteCalendarUnit];
you can set its repeat interval according to you, it would be minute, hours, day,month, year.

Related

Liquidsoap play news once every hour

I have an internet radio playing a playlist.
The stream is managed by Liquidsoap. How can I make it play once news in every hour?
If I set a 0m0s-4m0s interval in switch and the track playing before the news finishes at x o'clock 1 minute and the news is 2 minutes long then it plays twice because the end of the news is still in the 0m0s-4m0s interval. I have tried the add function, but it resulted in playing both the news and music in the same time. If I just specify the start time rather than an interval then news is not going to be played if a track is still playing at the start time. I've also tried to put news into a playlist.once source and it worked, but it did not play next time.
Thanks for help in advance and sorry for my bad english.
I post the current code below:
news = playlist.once("/professzor/dj/playlists/newsplist.m3u")
radio = fallback([switch([({0m0s-4m0s},news)]), pl, single("/professzor/dj/beep.wav")])

Is there an alternative to using an NSTimer to display remaining time of audio file with AVAudioPlayer?

I play music with AVAudioPlayer and want to display the remaining time. It seems many suggest an NSTimer that fires every second but I am afraid this is inefficient and prone to error. Since NSTimer is not very precise timing (I have heard) it can be that the timer fires twice within the same second of audio, and the countdown then jumps over one second. Also this is a pull model.
Is there a more savvy way where AVAudioPlayer would call my countdown every time a second ticks away?
While NSTimer is semi-inaccurate, you can still just have it call every second or so and get information from the currentTime property of the song, and compare it to the duration property. From that you can calculate remaining time etc.
AVAudioPlayer Documentation
There are no callbacks available to help you handle updating the time display when playing an audio file. The NSTimer method is how it should be done. If you're concerned with inaccuracies in the display due to NSTimer firing precision, just reduce your timer's update interval. Keep the workload light in your implementation and set the interval to 500ms, or perhaps 250ms...

What to happend when I registerLocalNotification to a past time?

If I register a NSLocalNotification to a past time,wheather it will destory automaticly,or it take one schedule count in the system and never destory.
As though,we know the loacalNotification is limit to the 64 counts,when the notification register to the past time got to the 64 counts.The other lotification Whether happend or not
If you create a notification in the past time .. it will play right then.. and your app delegate's didRecieveNotification method is called.

iPhone - NSTimer - Peculiar task needed

I know how to set a timer and when timer expires, it fires and a action is caught.
What I'm expecting is that after 30 seconds of every one hour of real time that that "xx:00:30" I have to check my server for updates.
I know how to communicate with server. But how can I create such a timer that fires every "xx:00:30".
I don't want to run the timer if the app is in background.
Any ideas on how to do this?
As mentioned by Marcus in his last message,
NSTimer's initWithFireDate:interval:target:selector:userInfo:repeats: or setFireDate:
works.

Keep the code Running In background in Ios

I want to run code in background for an infinite time and not for only 10 mins. I am not using Music or GPS or Viop. I want to show continuous local notification with some time interval. I have achieved the work with constraint of 10 mins. Please help.
What #phooze said was right.To show continuous local notification with some time interval use repeatInterval property.