UILocalNotifications 使用 NSWeekdayCalendarUnit 重复间隔
好的,所以我看到几篇文章说你不能设置 UILocalNotification 来重复超过或少于几个给定的选项(每分钟/小时/天/周/月等)。
但是,这些帖子都没有解决将 UILocalNotification
的 repeatInterval
属性设置为 NSWeekdayCalendarUnit
的作用。
我对所有 NSDate 和 NSCalendar 的东西都很陌生,所以我确信我错过了一些东西,但我已经阅读了文档,听起来你可以使用 NSWeekdayCalendarUnit
来制作 NSLocalNotification
重复说,如果 NSWeekdayCalendarUnit
设置为 2,3,5,每周一、周二和周四。
NSWeekdayCalendarUnit 指定工作日单位。 对应的值是一个int。等于 kCFCalendarUnitWeekday。工作日单位是数字 1 到 N(对于公历,N=7,1 是星期日)。
这不正确吗?
提前致谢。
OK, so I have seen several posts that say you cannot set a UILocalNotification
to repeat any more or less than a few given options (every minute/hour/day/week/month etc.).
However, none of those posts addressed what setting the repeatInterval
property of UILocalNotification
to NSWeekdayCalendarUnit
would do.
I'm very new to all this NSDate and NSCalendar stuff, so I am sure I am missing something, but I have read over the documentation and, it sounds like you CAN use NSWeekdayCalendarUnit
to make a NSLocalNotification
repeat say, every Monday, Tuesday and Thursday if NSWeekdayCalendarUnit
is set to 2,3,5.
NSWeekdayCalendarUnit
Specifies the weekday unit.
The corresponding value is an int. Equal to kCFCalendarUnitWeekday. The weekday units are the numbers 1 through N (where for the Gregorian calendar N=7 and 1 is Sunday).
Is that not correct?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你可以。我就是这样做的。用户可以使用选择器选择方案。然后选择进入以下方法:
Yes you can. I do it like this. The user can choose a scheme with a picker. And then the choice goes to the following method: