在我的通知确实收到方法,我希望应用程序转到选定的选项卡并显示选项卡的根视图控制器。
我尝试了以下实现,但所选标签未显示根视图控制器。我怎样才能做到这一点?
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
self.tabController.selectedIndex = 2;
//Pop View Controller to root
[self.tabController.selectedViewController.navigationController popViewControllerAnimated:NO];
}
答案 0 :(得分:0)
尝试
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
self.tabController.selectedIndex = 2;
//Pop View Controller to root
[self.tabController.selectedViewController.navigationController popToRootViewControllerAnimated:NO];
}