检测到按下UILocalNotification关闭按钮?

时间:2012-04-05 07:44:57

标签: objective-c ios uilocalnotification

我怎样才能处理Objective-C中UILocalNotification的关闭事件?
或者我可以检测到通知已经完成? 如何修改此代码以在关闭按钮中编码?

localNotification.alertBody=[NSString stringWithFormat:@"%@",[tmpdict objectForKey:@"Reminder"]];

NSDictionary *snoozeDic=[tmpdict objectForKey:@"Snooze"];
if ([[snoozeDic valueForKey:@"Switch"]intValue]==1) {
    localNotification.alertAction=@"Snooze";
} else
{
    localNotification.hasAction=NO;
}

1 个答案:

答案 0 :(得分:1)

无法访问“关闭”按钮操作。在安排LocalNotification后,它变为System事件,您只能使用“didReceiveLocalNotification”访问“view”事件

- (void)application:(UIApplication *)application 
        didReceiveLocalNotification:(UILocalNotification *)notification

相信我,我希望事实并非如此......