为什么我收到预定本地通知的两个警报?

时间:2010-09-05 21:17:39

标签: iphone notifications

我收到以下通知的两个提醒,我不能为我的生活找出原因。代码似乎只被调用一次,但App:didReceiveLocalNotification被调用两次。我无法弄明白为什么!

    NSLog(@"Configuring notifications time is up.");
    noTimeLeft=[[UILocalNotification alloc]init];
    noTimeLeft.fireDate=meterEndTime;
    noTimeLeft.alertBody=@"Your parking meter has expired!";
    noTimeLeft.alertAction=@"Go to meter";
    noTimeLeft.userInfo=[NSDictionary dictionaryWithObject:self.meterEndTime forKey:@"NSDate"];
    [[UIApplication sharedApplication] scheduleLocalNotification:noTimeLeft];
    NSLog(@"Configuring notifications finished time is up.");

1 个答案:

答案 0 :(得分:3)

local notification "didReceiveLocalNotification" calls twice

原来这是模拟器中的一个错误。

我在搜索时是怎么回答这个问题,哈哈。