0
如果我的应用在活动时收到UILocalNotification
,我想显示自己的UIAlertView
并关闭系统警报。下面是我在做什么:应用程序处于活动状态时的UILocalNotification?
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
if (application.applicationState == UIApplicationStateActive)
{
UIAlertView *alert = ...
[alert show];
}
[[UIApplication sharedApplication] cancelLocalNotification:notification];
}
我自己的警报显示出来,但系统警报莫名其妙地保留在系统中,并且当我离开我的应用程序中。
我在做什么错?
你可以看看下面的链接; http://stackoverflow.com/questions/9555564/is-it-possible-to-pop-up-local-notifications-while-the-iphone-app-is-on-screen –