Tag: datepicker localnotification

在特定的日子重复UILocalNotification

我需要设置UILocalNotification,我只需要从DatePicker中花费小时和分钟,并需要设置特定的date(如:星期一) ,并在每个星期一重复。 我有两个问题: 第一 ; 是否可以在dateselect器的date部分仅显示“星期天”这样的“date名称”? 第二个问题是, 如果我想为本地通知设置特定的date,那么正确的代码是什么? 谢谢你的答案,这里是我的代码如下; -(IBAction) alarmButton:(id)sender { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; dateFormatter.timeZone = [NSTimeZone defaultTimeZone]; dateFormatter.timeStyle = NSDateFormatterShortStyle; dateFormatter.dateStyle = NSDateFormatterShortStyle; NSString *dateTimeString = [dateFormatter stringFromDate: dateTimePickerSet1.date]; NSLog ( @"Alarm Set :%@" , dateTimeString); [self scheduleLocalNotificationWithDate1: dateTimePickerSet1.date]; } -(void)scheduleLocalNotificationWithDate1:(NSDate *)fireDate { UILocalNotification *notification = [[UILocalNotification alloc] init]; notification.fireDate = […]