提醒应用程序 - 重复某个提醒

问题描述:

我正在构建提醒应用程序,并且对如何设置提醒以便每天/每月/每小时重复一次提醒感兴趣。提醒应用程序 - 重复某个提醒

基本上我想设置一些重复,即使我的应用程序没有运行。在我的情况下,本地通知火灾。

谢谢!

您可以轻松设置使用NSCalendarUnits

notification.repeatInterval= NSDayCalendarUnit; 

更多日历单位重复间隔检查常量上http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSCalendar_Class/Reference/NSCalendar.html#//apple_ref/doc/c_ref/NSCalendarUnit

你必须使用本地推送通知,因为当你的应用程序在后台运行,这是唯一的办法苹果将允许你做一些事情:

检查本作进一步的信息:http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008194-CH1-SW1

这是一个很好的教程:http://www.icodeblog.com/2010/07/29/iphone-programming-tutorial-local-notifications/

查看苹果的参考文件here使用UILocalNotifications。我相信这就是你要找的。

只要你愿意,你可以利用UILocalNotifications在特定时间或日期显示本地通知。

David Linsin在这个here也有一个很好的帖子。

祝你好运!