我有定时器重置问题。如何让计时器开始计时通知,这意味着在按下最后一个按钮之前有200秒的延迟?
- (IBAction)buttonPressed:(id)sender {
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:200];
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.alertBody = @" More Quiz ";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
}
答案 0 :(得分:1)
你不是。只需致电cancelLocalNotification:
并安排一个新的。