See this example, in More tabbar controller, already created tableview, but how the delegate call ? code inside appdelegate.m ? or where ?
Quote:
Originally Posted by Brix
Have a check of which row was clicked. For example if,
TableView
Row 1 - Book1
Row 2 - Book2
Row 3 - Book3
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if( indexPath.row == 1 )
{
Book1 *xBook1 = [[Book1 alloc] initWithNibName:@"Book1" bundle:nil];
[self.navigationController pushViewController:xBook1 animated:YES];
[xBook1 release];
}
else if( indexPath.row == 2 )
{
Book2 *xBook2 = [[Book2 alloc] initWithNibName:@"Book2" bundle:nil];
[self.navigationController pushViewController:xBook2 animated:YES];
[xBook2 release];
}
else if( indexPath.row == 3 )
{
Book3 *xBook3 = [[Book3 alloc] initWithNibName:@"Book3" bundle:nil];
[self.navigationController pushViewController:xBook3 animated:YES];
[xBook3 release];
}
}
This is the concept.
|