在一周的某些天重复UILocalNotification

编程入门 行业动态 更新时间:2024-10-24 10:26:33
本文介绍了在一周的某些天重复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?

推荐答案

很遗憾你不能设置 repeatInterval 属性 UILocalNotification 仅在特定日期重复。您可以设置每天(每天),每月(每月)或每小时(每小时)重复一次。因此,对于您的问题唯一可行的解​​决方案是,如果您想在星期日,星期一和星期二设置闹钟,那么您必须设置3个闹钟(星期日,星期一和星期二各一个)而不是一个闹钟。

Unfortunately you cannot set the repeatInterval property of UILocalNotification 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.

更多推荐

在一周的某些天重复UILocalNotification

本文发布于:2023-11-27 05:12:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636742.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:UILocalNotification

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!