如何在didReceiveRemoteNotification中显示detailViewController?

时间:2015-01-17 13:46:45

标签: ios objective-c xcode parsing push-notification

我的方案,我有一个有三个标签的应用程序。每个选项卡都有一个tableViewController。当您点击tableViewCell时,将显示详细视图控制器,并为详细视图控制器设置webview。我的问题是,当用户在应用程序运行且处于非活动状态时点击推送通知时,如何显示详细视图控制器。

这是我的应用程序代码:didReceiveRemoteNotification方法:

// Set the view to HotTableViewController when user tapped on remote notification
    UIStoryboard *ab = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    HotTableViewController *hotArticle = [ab instantiateViewControllerWithIdentifier:@"hotArticle"]; //hotArticle identifier is detailVC id name
    UITabBarController *tabController = (UITabBarController *)self.window.rootViewController;
//    tabController.selectedIndex = 0;
    UINavigationController *navigationController = (UINavigationController *)tabController.selectedViewController;
    [navigationController pushViewController:hotArticle animated:YES];

这是图像故事板图像:

http://i.imgur.com/8BC9QrI.png

0 个答案:

没有答案