1
하나의 알람으로 시계 앱을 만들고 있습니다.버튼으로 알람 알림 켜고 끄기
알람을 설정하는 버튼, 알람을 켜는 버튼 및 알람을 끄는 버튼이 있습니다. 로컬 알림을 사용
SET 버튼 작동 :
UILocalNotification *scheduledAlert;
[[UIApplication sharedApplication] cancelAllLocalNotifications];
scheduledAlert = [[UILocalNotification alloc] init];
scheduledAlert.applicationIconBadgeNumber=1;
scheduledAlert.fireDate = alarmPicker.date;
scheduledAlert.timeZone = [NSTimeZone defaultTimeZone];
scheduledAlert.repeatInterval = NSDayCalendarUnit;
[email protected]"alarm_clock_ringing.wav";
scheduledAlert.alertBody = @"I’d like to get your attention again!";
[[UIApplication sharedApplication]
scheduleLocalNotification:scheduledAlert];
모든 것이 잘 작동합니다.
그러나 켜기 및 끄기 버튼을 코딩하는 방법을 알지 못합니다.
나는 CancelAllCurrentNotifications에 대해 정말로 조언하고 싶습니다. http://weblog.bignerdranch.com/780-notifications-part-3-gotchas/ – Daniel