I am new to iphone development. I am displaying an array of data in a table. Upon clicking the row, it navigates to the corresponding detail view. I want to display a title in the detail view corresponding to the row selected in the table.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if([[tableList objectAtIndex:indexPath.row] isEqual:@"Display The Text"])
{
secondviewcontroller *second= [[secondviewcontroller alloc] initWithNibName:@"secondviewcontroller" bundle:nil];
[self.navigationController pushViewController:second animated:YES];
}
if([[tableList objectAtIndex:indexPath.row] isEqual:@"iPhone Image"])
{
thirdviewcontroller *third= [[thirdviewcontroller alloc] initWithNibName:@"thirdviewcontroller" bundle:nil];
[self.navigationController pushViewController:third animated:YES];
}
}
If "display the text" is selected, the corresponding navigated view should have it's title set to "display the text" below the navigation bar as title for a header and if "iphone image" is selected, the corresponding view should display the title has "iphone image" below the navigation bar as title for header.
Please help me out.Thanks.