在一周的某些天重复UILocalNotification [英] Repeat UILocalNotification on certain days of week

查看:93
本文介绍了在一周的某些天重复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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆