Accessing UITabBarController from UIVIewController

后端 未结 2 1310
清酒与你
清酒与你 2021-02-02 12:25

I am developing an application based on UITabbar and the view hierarchy as follows.

UITabBarController ----> UINavigationController ----> UIViewController

I need

2条回答
  •  不思量自难忘°
    2021-02-02 12:49

    You are doing it wrong.

    I've an app same as yours. I can access tabbar from viewDidLoad.

    Try this:

    - (void)viewDidLoad {
        [super viewDidLoad];
        [self.tabBarController setSelectedIndex:1];
    }
    

    Hope this helps.. :)

提交回复
热议问题