UILocalNotification을 설정해야하는데 DatePicker에서 시간과 분이 걸릴 필요가 있으며 (예 : 월요일)을 설정하고 매주 월요일에 반복해야합니다.특정 날짜에 반복 UILocalNotification
나는 그것에 대해 두 가지 질문이 있습니다.
처음으로; 날짜 선택 도구의 날짜 섹션에 '일요일'과 같은 '요일 이름'만 표시 할 수 있습니까?
두 번째 질문은; 현지 알림을위한 특정 날짜를 설정하려면 올바른 코드는 무엇입니까?
해답을 제공해 주셔서 감사 드리며 여기에 제 코드가 있습니다.
-(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 = fireDate;
notification.alertBody = @"Alarm Set !";
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
확인 - http://useyourloaf.com/blog/2010/09/13/repeating-an-ios-local-notification.html 또는 c 또한 http://stackoverflow.com/questions/14769462/set-repeatinterval-in-local-notification 또는 http://stackoverflow.com/questions/18014438/repeating-a-local-notification-after-documentation.asp에서 도움을 받으십시오. every-14-daystwo-weeks – Bharat