title: Multi-Level navigation in iphone in xcode 4.2
body: <p>I created a View-based project in xcode 4.2 and i want to achieve multi-level navigation to navigate to different views. My first view class is ViewController where i display a table. On Clicking a row i go to a next class which has a tabbar. in this i have 3 tabs. the 1st Tab is using the Class BuyerViewController. It has 4 buttons. The problem is that when i click on the button it does not push the next class. </p>
  
  <p>ViewController.m</p>
  
  <pre><code>- (void)viewDidLoad
  {
   self.title=@"Select County";
      tView = [[UITableView alloc] init];    //tView is my table view object.
      tView.frame=CGRectMake(0, 20, 320, 460);
      [tView setDelegate:self];
      [tView setDataSource:self];
      [self.view addSubview:tView];
  }
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  return 1;
  }
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  return [countyArray count];
  }
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
  static NSString *CellIdentifier = @"Cell";
  
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil) {
      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
  }
  cell.textLabel.text = [countyArray objectAtIndex:indexPath.row];
  return cell;
  }
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 
  //This works fine and pushes to my next class to show the tabs.
  
  ShowOptionInTab *showTabbar = [[ShowOptionInTab alloc] initWithNibName:@"ShowOptionInTab" bundle:nil];
  [self.navigationController pushViewController:showTabbar animated:YES];
  [showTabbar release];
  }
  </code></pre>
  
  <p>ShowOptionInTab.m</p>
  
  <pre><code>-(void)loadView {
  UIView *contentView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
  contentView.backgroundColor = [UIColor whiteColor];
  self.view = contentView;
  [contentView release];
  
  BuyerViewController *buyerController = [[BuyerViewController alloc] init ];
  
  SellerViewController *sellerController = [[SellerViewController alloc] init];
  
  LenderViewController *lenderController = [[LenderViewController alloc] init];
  
  buyerController.title=@"Buyer";
  sellerController.title = @"Seller";
  lenderController.title = @"Lender";
  
  UITabBarController *tabbarController = [[UITabBarController alloc] init];
  
  tabbarController.view.frame = CGRectMake(0, 0, 320, 460);
  [tabbarController setViewControllers:[NSArray arrayWithObjects:buyerController, sellerController,lenderController, nil]];
  
  [buyerController release];
  [sellerController release];
  [lenderController release];
  [self.view addSubview:tabbarController.view];    
  }
  </code></pre>
  
  <p>BuyerViewController.m</p>
  
  <pre><code>-(void)viewWillAppear:(BOOL)animated
  {
  UIButton *quickEstimateButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  
      [quickEstimateButton addTarget:self action:@selector(getTagOfPressedButton:) forControlEvents:UIControlEventTouchUpInside];
  [quickEstimateButton setTitle:@"QUICK ESTIMATE" forState:UIControlStateNormal];
  quickEstimateButton.tag=1;
  quickEstimateButton.frame = CGRectMake(10, 50, 150, 40.0);
  [self.view addSubview:quickEstimateButton];
  
  //more 3 buttons are added in same way
  }
  -(void) getTagOfPressedButton:(id)sender {
  
  UIButton *getTagOfButton = (UIButton *)sender;
  int buttonPressedTag = getTagOfButton.tag;
  NSLog(@"TAG==========%d",buttonPressedTag);
  if(buttonPressedTag==1)
  {
      NSLog(@"quick estimate pressed");
      QuickEstimateViewController *q = [[QuickEstimateViewController alloc] init];
      NSLog(@"nav====%@",self.navigationController); //This returns null.
      [self.navigationController pushViewController:q animated:YES];
  }
  }
  </code></pre>
  
  <p>AppDelegate.m</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
          ViewController *overviewViewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
      UINavigationController* navigation = [[UINavigationController alloc] initWithRootViewController:overviewViewController];
      navigation.navigationBar.tintColor = [UIColor blackColor];
      [overviewViewController release];
  
      [self.window addSubview:[navigation view]];
      [self.window makeKeyAndVisible];
  }
  </code></pre>
  
  <p>Why does the the QuickEstimateViewController does not show up?</p>