Storyboard - UITabBarController

后端 未结 2 2016
感动是毒
感动是毒 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: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;
    

提交回复
热议问题