Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is how to add the NavigationController programmatically (e.g. in you AppDelegate) </p> <pre><code> UIViewController *viewController1, *viewController2; viewController1 = [[[UIViewController alloc] initWithNibName:@"FirstViewController_iPhone" bundle:nil] autorelease]; UINavigationController *navigationcontroller = [[[UINavigationController alloc] initWithRootViewController:viewController1] autorelease]; viewController2 = [[[UIViewController alloc] initWithNibName:@"SecondViewController_iPhone" bundle:nil] autorelease]; self.tabBarController = [[[UITabBarController alloc] init] autorelease]; self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationcontroller, viewController2, nil]; </code></pre> <p>If you have a tableview in the Viewcontroller1 you can access the Navigationcontroller by using <code>self.navigationController</code> e.g. in the <code>didSelectRowAtIndexPath</code> to open a DetailView</p> <p>eg. </p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil]; [self.navigationController pushViewController:detailViewController animated:YES]; [detailViewController release]; } </code></pre> <p>In this example the detailViewController inits with a NIB file, which adds a navigation bar with a back button. But if you init the <code>detailViewController</code> programmatically aswell, you can add an action (GoBack) to a <code>UIBarButtonItem</code> to remove the <code>detailViewController</code> from its navigationcontroller.</p> <pre><code>-(void) GoBack { [self.navigationController popViewControllerAnimated:YES]; } </code></pre>
    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.
    3. 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