UILocalNotification firedate作为每天的固定时间



我想将UILocalNotificationfiredate设置为每天上午11:00和晚上11:00(即每12小时一次)。我怎样才能做到这一点呢?请建议。

创建两个独立的UILocalNotifications并指定重复间隔

enum {
   NSEraCalendarUnit = kCFCalendarUnitEra,
   NSYearCalendarUnit = kCFCalendarUnitYear,
   NSMonthCalendarUnit = kCFCalendarUnitMonth,
   NSDayCalendarUnit = kCFCalendarUnitDay,
   NSHourCalendarUnit = kCFCalendarUnitHour,
   NSMinuteCalendarUnit = kCFCalendarUnitMinute,
   NSSecondCalendarUnit = kCFCalendarUnitSecond,
   NSWeekCalendarUnit = kCFCalendarUnitWeek,
   NSWeekdayCalendarUnit = kCFCalendarUnitWeekday,
   NSWeekdayOrdinalCalendarUnit = kCFCalendarUnitWeekdayOrdinal,
   NSQuarterCalendarUnit = kCFCalendarUnitQuarter,
   NSCalendarCalendarUnit = (1 << 20),
   NSTimeZoneCalendarUnit = (1 << 21),
};
typedef NSUInteger NSCalendarUnit;

相关内容

  • 没有找到相关文章

最新更新