Tag: datepicker uilocalnotification

在本地通知中设置repeatInterval

我想设置重复时间间隔为用户从dateselect器中select的值。我在我的应用程序中有types倒计时模式的dateselect器。如果用户从dateselect器中select4小时15分钟,那么我使用下面的代码和闹铃。 [NSDate dateWithTimeIntervalSinceNow:[pickerTimer countDownDuration]] 但是我希望通知应在每4小时15分钟后重复,直到用户取消为止。 我已经做了很多search,但是我弄不清楚。到目前为止,我使用的代码是: localNotification = [[UILocalNotification alloc] init]; [localNotification setFireDate:[NSDate dateWithTimeIntervalSinceNow:[pickerTimer countDownDuration]]]; if(localNotification.fireDate){ [self _showAlert:@"Time is scheduled" withTitle:@"Daily Achiever"]; } localNotification.timeZone = [NSTimeZone systemTimeZone]; localNotification.alertBody=@"alaram"; localNotification.soundName = UILocalNotificationDefaultSoundName; [localNotification setAlertAction:@"View"]; [localNotification setRepeatInterval:[pickerTimer countDownDuration]]; //The button's text that launches the application and is shown in the alert // [localNotification setAlertBody:[alertBodyField text]]; //Set the […]