本地通知替代周重复 [英] Local Notification alternative week repeat

查看:40
本文介绍了本地通知替代周重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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];

这篇关于本地通知替代周重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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