Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I normally don't touch <code>MainWindow.xib</code>. I suggest the following:</p> <ol> <li><p>Create a <code>MainController</code> which will be your MainView that subclass <code>UIViewController</code> by going to <code>File &gt; New &gt; New File</code>. That will create a .h/.m and nib file for each ViewController. There add whatever UI you want for your app. For Example, add two buttons and wire those buttons to <code>IBActions</code> in your MainController. This should be declared and implemented in your <code>MainController.{h/m}</code>, respectively.</p></li> <li><p>After that create another two ViewControllers, the same way. </p></li> <li><p>The body of those IBActions should create an instance of the your ViewControllers and then push them.</p></li> </ol> <p>It would look something like this:</p> <pre><code>YourViewController *yvc = [[YourViewController alloc] init]; [self.navigationController pushViewController:yvc animated:YES]; [yvc release]; </code></pre> <p>Finally, you have to push the MainController in your <code>AppDelegate</code> and add your <code>NavigationController</code> to the view.</p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { MainViewController *mvc = [[MainViewController alloc] init]; UINavigationController *unvc = [[UINavigationController alloc] init]; [unvc pushViewController:mvc animated:NO]; [mvc release]; [self.window addSubview:unvc.view]; [self.window makeKeyAndVisible]; return YES; } </code></pre>
 

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