Search code examples
iosxcodeuiviewcontrollertabbarcontroller

How do you connect both nib-based and programmatically created view controllers in a tabbarcontroller?


I have created a tab based app drawing both nib-designed views and pragmatically designed views. How can I connect these into the UITabBarController despite being of different types?


Solution

  • How did you create it?

    You must have allocated it and should have called some initialization method. Probably initWithStyle?

    Once that is done, and all your creation, configuration, layouting and adding of subviews is done, you want to display it. Just call

    [self.navigationController pushViewController:yourProperlySetUpViewController animated:YES];
    

    If you did everything else right then it should be displayed properly.

    ... did I misunderstand your Question?