Im currently creating an app with tableview now what i like to happen is when i click the first row it will show view1 and when i click the 2nd row it will show view2. How can i do this?
i tried to use an if else statement id my didSelectRowAtIndexPath but it did not work here is my piece of code
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
int EntryIndex = [indexPath indexAtPosition:[indexPath length]-1];
{
AboutViewController *aboutView = [[AboutViewController alloc]init];
aboutView.getId4 = [[contentArray objectAtIndex:EntryIndex]objectForKey:@"title"];
aboutView.aboutofficeId = getId3;
[self.navigationController pushViewController:aboutView animated:YES];
}
else
{
DepartmentsViewController *deptView = [[DepartmentsViewController alloc]init];
deptView.getId5 = [[contentArray objectAtIndex:EntryIndex]objectForKey:@"title"];
deptView.deptoffice = getId3;
[self.navigationController pushViewController:deptView animated:YES];
}
}
NOTE : You want to create and display UIView, so i putted here
UIViewNotUIViewController.