2

I have started working with story board ,a new feature in iOS 5,so I started with a tabbed application,then I added a table view controller and filled the cells with some dummy data,now,the table has 4 cells,now on click of each cell,I want to open a newViewController,which will be diffrent for each cell,

So previously,I used to code this way

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
   [tableView deselectRowAtIndexPath:indexPath animated:YES];

    if(indexPath.row == 0)
    {
        FirstViewController *settingsView =[[FirstViewController alloc]initWithNibName:@"FirstViewController" bundle:nil];
        [self.navigationController pushViewController:settingsView animated:YES]; 
    }
 if(indexPath.row == 1)
    {
        SecondViewController *settingsView =[[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
        [self.navigationController pushViewController:settingsView animated:YES]; 
    }
 if(indexPath.row == 2)
    {
        ThirdViewController *settingsView =[[ThirdViewController alloc]initWithNibName:@"ThirdViewController" bundle:nil];
        [self.navigationController pushViewController:settingsView animated:YES]; 
    }

}

But know,how shall I do it..please help me out

Thanks & Regards Ranjit

Ranjit
  • 4,576
  • 11
  • 62
  • 121
  • Please check this link http://maybelost.com/2011/10/tutorial-storyboard-in-xcode-4-2-with-navigation-controller-and-tabbar-controller-part1/ – developer9 Dec 05 '11 at 09:55

1 Answers1

0

Maybe this tutorial would help you? http://kurrytran.blogspot.com/2011/10/ios-5-storyboard-uitableview-tutorial.html

As I see this (performSegueWithIdentifier:sender:) should be the method to perform a new viewcontroller from the storyboard

https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instm/UIViewController/performSegueWithIdentifier:sender:

matzino
  • 3,544
  • 1
  • 18
  • 37