2012-04-05 56 views
0

我该如何能够在Objective-C的UILocalNotification的关闭事件中工作?
或者我可以检测通知已完成?
如何修改此代码以关闭按钮进行编码?检测到UILocalNotification关闭按钮被按下?

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

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

回答

1

没有办法访问关闭按钮操作。调度LocalNotification它成为一个系统事件,你只能与“didReceiveLocalNotification”

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

相信我访问“视图”事件发生后,我想这是不是这样的...