我试图设置一个UILocalNotification对象的repeatInterval属性。它适用于NSDayCalendarUnit,但我需要设置每三天的重复间隔。 我试过NSDayCalendarUnit + 3,但那不起作用。有任何想法吗?如何在iPhone应用中使用NSDayCalendarUnit
更新:
不,这是行不通的。如果我安排
localNotify.repeatInterval = NSDayCalendarUnit
日志显示:
<UIConcreteLocalNotification: 0x71aabf0>{fire date = 2010-07-16 02:40:00 -0400, time zone = US/Eastern (EDT) offset -14400 (Daylight), repeat interval = 16, next fire date = 2010-07-16 02:40:00 -0400}
如果我安排
localNotify.repeatInterval = NSDayCalendarUnit*3
日志显示:
<UIConcreteLocalNotification: 0x71b4ae0>{fire date = 2010-07-16 02:30:00 -0400, time zone = US/Eastern (EDT) offset -14400 (Daylight), repeat interval = 48, next fire date = 2010-07-17 03:30:00 -0400}
所以重复间隔前进一小时在第二天,而不是我希望这是3天内重复的时间。
有什么建议吗?
+3是一个不好的选择(你对隐含的单位是什么进行隐含的假设)。 * 3更好,但即使如此我也不确定。 – SK9 2011-08-12 08:15:04