이 코드는 로컬 알림을위한 것이며, 나는 자신의 메서드를 사용하여 scheduleNotification과 clearNotification을 가지고 있습니다.특정 UILocalNotification 취소
- (void)clearNotification {
[[UIApplication sharedApplication] cancelAllLocalNotifications];
}
- (void)scheduleNotification {
[reminderText resignFirstResponder];
[[UIApplication sharedApplication] cancelAllLocalNotifications];
Class cls = NSClassFromString(@"UILocalNotification");
if (cls != nil) {
UILocalNotification *notif = [[cls alloc] init];
notif.fireDate = [[datePicker date] dateByAddingTimeInterval:-30];
notif.timeZone = [NSTimeZone defaultTimeZone];
notif.alertBody = @"Evaluation Planner";
notif.alertAction = @"Details";
notif.soundName = UILocalNotificationDefaultSoundName;
notif.applicationIconBadgeNumber = 1;
NSDictionary *userDict = [NSDictionary dictionaryWithObject:reminderText.text forKey:kRemindMeNotificationDataKey];
notif.userInfo = userDict;
[[UIApplication sharedApplication] scheduleLocalNotification:notif];
[notif release];
}
}
이 코드는 잘 작동하지만 지금 나는 그것을 삭제되는 통지 객체 아는 방법을 알고 싶어요 : 다음은 코드입니다. 알림 용 ID를 만들고 싶습니다. 즉, 하나의 ID는 하나의 알림과 같습니다. 그러나 나는 어느 부분에서 그렇게해야하는지 모른다. 게다가 나는 이것을 plist에 포함시키는 방법을 찾아야한다.
누군가가 나를 도울 수 있기를 바랍니다. 감사.
변수 이름을 "not"로 지정하면 오류가 발생합니다. – OthmanT