그래서 기본적으로 로컬 알림을 지속적으로 제공하는 앱을 설정하려고합니다.2 분마다 알려주는 UILocalNotification을 만드는 방법
지금까지 내가 가지고 :
- (void)scheduleNotification {
[reminderText resignFirstResponder];
[[UIApplication sharedApplication] cancelAllLocalNotifications];
Class cls = NSClassFromString(@"UILocalNotification");
if (cls != nil) {
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [datePicker date];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = @"Your building is ready!";
notif.alertAction = @"View";
notif.soundName = UILocalNotificationDefaultSoundName;
notif.applicationIconBadgeNumber = 1;
NSInteger index = [scheduleControl selectedSegmentIndex];
switch (index) {
case 1:
notif.repeatInterval = NSMinuteCalendarUnit;
break;
case 2:
notif.repeatInterval = NSMinuteCalendarUnit*2;
break;
default:
notif.repeatInterval = 0;
break;
}
NSDictionary *userDict = [NSDictionary dictionaryWithObject:reminderText.text
forKey:kRemindMeNotificationDataKey];
notif.userInfo = userDict;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
}
}
내가하고 1 분마다 (나는 경우 2를 설정할 때) 내가 알림을 2 분마다 얻을 수있는 그것을 만들려고 해요 (나는 경우 1을 설정 한 경우) 통보 받는다. 유일한 문제는 ... * 2는 2 분마다 알림을 받도록 작동하지 않습니다. 2 분마다 알려주기 위해 어떻게해야합니까?