Storyboard - UITabBarController

后端 未结 2 1997
感动是毒
感动是毒 2020-12-28 16:41

I was playing around with iOS 5 and storyboards today. I currently have it so that the main storyboards starts with a uitabbarcontroller then a navigationviewcontroler and f

相关标签:
2条回答
  • 2020-12-28 17:28

    For me I can access the tabbar using self.navigationController.parentViewController; This always return the tabbar controller.

    0 讨论(0)
  • 2020-12-28 17:37

    Your app delegate will have a window property. That can be used to get a pointer to the storyboard's initial view controller (which will be your UITabBarController), like this example from one of my app delegates application:didFinishLaunchingWithOptions:

    UITabBarController *tabController =
       (UITabBarController *)self.window.rootViewController;
    tabController.selectedIndex =
       [defaults integerForKey:kOptionLastTabSelectedKey];
    tabController.delegate = self;
    
    0 讨论(0)
提交回复
热议问题