-(void)setNoti {
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:60];
localNotification.alertBody = @"NOTI 1";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1;
localNotification.repeatInterval = kCFCalendarUnitMinute;
NSDictionary *dict = @{@"nid":@"1"};
localNotification.userInfo = dict;
[[UIApplication sharedApplication]scheduleLocalNotification:localNotification];
}
为什么我的简单UILocalNotification没有触发?我的简单UILocalNotification没有触发
打印localNotification.fireDate的值是否正确或不正确? – svrushal
你需要[应用程序cancelAllLocalNotifications];因为通知是存储第一个值。 – Rock