Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I tried to create an iphone application with UITabBarController and some UINavigationController inside it and faced the same problems as "mamcx". With your example-code i get it to run :) Thanks a lot.</p> <p>Here is how it works for me.</p> <pre><code>// YOURS fourthNavigation = [[UINavigationController alloc ] init ]; fourthViewController = [[[FourthTabRootController alloc] initWithNibName:@"FourthView" bundle:nil] autorelease]; fourthNavigation.tabBarItem.title = @"YOURS"; fourthNavigation.viewControllers = [NSArray arrayWithObjects:fourthViewController, nil]; // Add self-defined UIViewControllers to the tab bar tabBarController.viewControllers = [NSArray arrayWithObjects:firstNavigation,secondNavigation, thirdNavigation, fourthNavigation, nil]; // Add the tab bar controller's current view as a subview of the window [window addSubview:tabBarController.view]; </code></pre> <p>The other UINavigationControllers "firstNavigation, ... " are created the same way. I load the view elements from nib-files that are connected to my subclassed UIViewController classes. You dont need to add a NavigationBar in the IB to your view, cause the UINavigationController has allready one. So you only need to set the title in "initWithNibName"</p> <pre><code> // The designated initializer. Override to perform setup that is required before the view is loaded. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization self.title = @"YOURS"; } return self; } </code></pre> <p>I hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload