我正在使用UILocalNotification。当通知显示,并且用户单击我的alertAction时,如何在应用程序加载时将它们指向特定的视图? (类似于日历应用程序向您显示刚刚收到通知的事件)。通知后UILocalNotification显示视图发生?
我使用:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOption {
UILocalNotification *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (localNotif) {
NSString *itemName = [localNotif.userInfo objectForKey:ItemListKey];
// [viewController displayItem:itemName]; // custom method
application.applicationIconBadgeNumber = localNotif.applicationIconBadgeNumber-1;
NSLog(@"has localNotif %@",itemName);
}
return YES;
}
我创建了didReceiveLocalNotification方法一个新的视图控制器你好我strucked同样的问题,但不工作 – 2012-06-28 06:35:15