从模态视图控制器ios7更改选项卡栏应用程序的选定索引

scr*_*309 3 uitabbarcontroller ios7

我正在ios7中的一个标签上展示一个模态视图控制器.根据用户的操作,我想更改选项卡栏控制器的选定索引.
我试过[(UITabBarController*)self.parentViewController setSelectedIndex:0];

这不会更改基础选项卡栏的selectedindex.如果还有其他办法,请告诉我

Mar*_*les 7

做就是了

UITabBarController *tabBarController = (UITabBarController *)self.presentingViewController;
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
[tabBarController setSelectedIndex:1];
Run Code Online (Sandbox Code Playgroud)