2
votes

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

1
Please check this link maybelost.com/2011/10/… - developer9

1 Answers