I am working on an alarm app for the iPhone and I cant seem to figure this out. My question is regarding capabilities o开发者_JAVA技巧f backgrounding. Is it possible for a user to specify a certain time for an alarm to play in my app, say 7:00 AM. The user is using iOS 4, and exits the app, but it is still running in the background. Is there anyway for my app to play a specific sound file at that specified time, 7:00 AM? Or can I order my app to relaunch itself somehow at that specific time. If none of these are possible, what are the closest alternatives?
You should use a background (local) notification for this - they can trigger sounds.
In iOS 4.0 you can create a UILocalNotification set to go off at a specific time/date.
精彩评论