开发者

Objective C: Tabbar Controller: How do I select the tab and pop the set of views to root?

开发者 https://www.devze.com 2023-03-21 20:13 出处:网络
In my notification did receive method, I want the app to go to the selected tab and display the root view controller of the tab.

In my notification did receive method, I want the app to go to the selected tab and display the root view controller of the tab.

I tried the following implementation bu开发者_运维技巧t the selected tab did not display the root view controller. How can I make this work?

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    self.tabController.selectedIndex = 2; 

    //Pop View Controller to root
   [self.tabController.selectedViewController.navigationController popViewControllerAnimated:NO];     
}


Try

-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    self.tabController.selectedIndex = 2; 

    //Pop View Controller to root
   [self.tabController.selectedViewController.navigationController popToRootViewControllerAnimated:NO];     
}
0

精彩评论

暂无评论...
验证码 换一张
取 消