本文介绍了本地通知替代周重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个通知,我想每隔一周重复一次.
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];
更多推荐
本地通知替代周重复
发布评论