在一周中的某些日子重复 UILocalNotification
我想将 UILocalNotification
的重复间隔自定义为一周中的某些天。我还没有找到任何关于这方面的信息。
如何设置一周中某些日子的通知重复间隔,例如在周日、周一和周五重复通知?
I want to customize the repeat interval of a UILocalNotification
to be on certain days of the week. I haven't found any information about this.
How can I program the repeat interval for notifications for certain days of the week, for example, repeat a notification on Sunday, Monday, and Friday?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,您无法将
UILocalNotification
的repeatInterval
属性设置为仅在特定日期重复。您可以设置每天重复、每月重复或每小时重复。因此,针对您的问题唯一可行的解决方案是,如果您想在周日、周一和周二设置闹钟,那么您必须设置 3 个闹钟(周日、周一和周二各一个),而不是一个闹钟。Unfortunately you cannot set the
repeatInterval
property ofUILocalNotification
to repeat only on particular days. You can set either repeat daily (every day), monthly (every month) or hourly (every hour). So the only feasible solution for your question is that if you want to set an alarm on Sunday, Monday and Tuesday then you have to set 3 alarms (one each for Sunday ,Monday and Tuesday) rather than one alarm.如果您需要自定义
repeatInterval
属性。您必须在指定时间设置每个UILocalNotification
。这是我的代码。If you need to custom
repeatInterval
property. You have to setup eachUILocalNotification
on specify time. here is my codes.