本地通知替代周重复

编程入门 行业动态 更新时间:2024-10-26 16:28:30
本文介绍了本地通知替代周重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有两个通知,我想每隔一周重复一次.

I Have two notification and I want to repeat it alternative week.

例如在第1周的星期一设置了一个通知,该通知应在第3周的星期一重复.第二次通知设置在第2周的星期二,并且应在第4周的星期二重复.

E.g. One notification set on 1st week's monday and it should repeat on 3rd week's monday. Second notification set on 2nd week's tuesday and it should repeat on 4th week's tuesday.

我应该怎么做?

推荐答案

-(NSString*) getWeekOfMonth { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; [dateFormatter setTimeStyle:NSDateFormatterShortStyle]; [dateFormatter setDateFormat:@"W"]; NSString *weekNumber = [dateFormatter stringFromDate:[NSDate date]]; [dateFormatter release]; return weekNumber; } NSInteger weekInt = [weekNumber integerValue];

更多推荐

本地通知替代周重复

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

发布评论

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

>www.elefans.com

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