2011-08-06 105 views

回答

24

你不能设置自定义重复间隔UILocalNotification。之前已经询问过(见下文),但只提供了有限的选项。 repeatInterval parameter是一个枚举类型,它仅限于specific values

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

有重复间隔乘数posted here的要求。您可以添加评论。我建议向苹果提交一个错误报告或功能请求(url?)。

+4

苹果[文件](https://developer.apple.com/library/ios/documentation/iphone/conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072 -CH4-SW5)表示**一个应用程序可以同时安排128个本地通知**:_您的应用程序在任何给定时间不能有超过128个本地通知活动,其中任何一个可以配置为在指定的时间重复interval._ – nburk

+0

@nburk评论中的链接不再有效。你碰巧知道你说的话是否仍然准确? – ndmeiri

+1

iOS 10有一个新的重复通知选项,其自定义时间间隔选项+(实例类型)triggerWithTimeInterval:(NSTimeInterval)timeInterval重复:(BOOL)重复; –

2

只需制作参数为interval和weekday的方法。并调用 功能每u必须设置为alarm.But平日 的通知时间下面给出的方法 将被解决separately.As我呼吁:

  [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]; 

我通过平日星期一的不同日子参数为2,星期一为 ,星期二为3,等等。

I hope it will help u...! 
相关问题