开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜