UILocalNotification自定义闹钟重复间隔(太阳,星期一,星期三,星期四,星期五,星期五,星期六)

我使用UILocalNotification作为报警目的。 我有一个自定义选项重复基于平日(太阳,星期一,星期二,星期四,星期五,星期五,星期六)。 这么多的应用程序完成了这个过 我最好地尝试了我的水平。 但是我无法让它工作。 请你们帮我….

您无法使用UILocalNotification设置自定义重复间隔。 这已经被问到过(见下文),但只提供了有限的选项。 repeatInterval参数是一个枚举types,它仅限于特定的值 。

你不能乘以这些枚举并得到这些间隔的倍数。 您的应用程序中不能设置超过64个本地通知。 一旦触发通知,就不能重新安排通知,除非用户select在通知触发时运行应用程序(它们可能无法运行)。

有一个请求重复时间间隔倍数张贴在这里 。 您可以添加评论。 我build议向苹果提交一个错误报告或function请求(url?)。

  • 如何将本地通知重复间隔设置为自定义时间间隔?
  • UILocalNotification的自定义重复间隔
  • 自定义UILocalNotification重复间隔
  • UILocalNotification重复
  • UILocalNotification中的非固定repeatInterval
  • 我可以有自定义的UILocalNotification重复时间间隔(即只有工作日?)
  • 重复UILocalNotifications与差距
  • 在一周中的某几天重复UILocalNotification

简单地做一个参数间隔和星期几的方法。 每次需要设置闹钟时调用该函数,但是平日的通知要单独解决。因为我已经调用了如下的方法:

  [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:2 :tempDict] andRepeatInterval:NSWeekCalendarUnit]; [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:3 :tempDict]andRepeatInterval:NSWeekCalendarUnit]; [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:4 :tempDict] andRepeatInterval:NSWeekCalendarUnit]; [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:5 :tempDict] andRepeatInterval:NSWeekCalendarUnit]; [self notificationWithItem:tempDict Date:[self SetDateForAlarmWithWeekday:6 :tempDict] andRepeatInterval:NSWeekCalendarUnit]; 

星期一的星期几,星期二的星期三,星期二的星期三,星期几等。

 I hope it will help u...!