以下是设置闹钟一次的代码,
-(IBAction) alaramSetButton:(id)sender{
NSDateFormatter *dateFormatter =[[NSDateFormatter alloc]init];
[dateFormatter setTimeZone:[NSTimeZone defaultTimeZone]];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
NSString *dateTimeSetting=[dateFormatter stringFromDate:dateTimePicker.date];
//Date format mm/dd/yy
NSLog(@"dateTimeSetting %@",dateTimeSetting);
[self scheduleLocalNotificationWithDate: [dateFormatter dateFromString:dateTimeSetting]];
[self alarmMessage:@"Alarm setted"];
[dateFormatter release];
}
它工作正常,但我试图在每个星期一或每个星期二设置闹钟或重复闹钟,为此我没有得到如何开始或添加什么功能。任何建议都会非常有帮助。在此先感谢。