Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>UIWindow doesn't cope well if you try to put views from two view controllers into it: only the last one will get the appropriate callbacks, and they won't know about each other. (I have done this intentionally, when I wanted a constant animated background behind a transparent set of views, but it's tricky.) In ios4 this is more explicit: UIWindow has grown a "rootViewController" property which holds <em>the</em> VC for the window.</p> <p>What you want here is a tab bar controller <em>containing</em> navigation controllers, one per tab, each containing one of your custom VCs.</p> <p>sort of like: (this is off the cuff and untested, so watch for errors)</p> <pre><code>PersonListViewController* plvc = [[[PersonListViewController alloc] initWithNibName:@"PersonListViewController" bundle:nil] autorelease]; UINavigationController *uinc = [[[UINavigationController alloc] initWithRootViewController:plvc] autorelease]; // ... make more VCs for any other tab pages here UITabBarController* tbc = [[[UITabBarController alloc] init] autorelease]; [tbc setViewControllers:[NSArray arrayWithObjects: uinc, nil]]; // *1 /* iOS 4 and later, preferred: */ [window setRootViewController:tbc]; /* or, alternatively, in iOS 3: [window addSubview:[tbc view]]; [self setMyMainTabsController:tbc]; // must keep an owning reference or it'll get released */ [window makeKeyAndVisible]; </code></pre> <p>at *1, add any VCs for other tabs to the list.</p> <p>Putting nav controllers inside a tab controller is perfectly legit and Apple-endorsed. Putting tab controllers inside nav controllers isn't, though it may work in limited cases.</p>
    singulars
    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.
    2. VO
      singulars
      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