Well, I'd like to push a view onto the navigation stack. I've used the following code in another tableview app that did not have any sections and it worked great:
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger row = [indexPath row];
SecondLevelViewController *nextController = [self.controllers objectAtIndex:row];
[self.navigationController pushViewController:nextController animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
//The secondviewcontroller is subclassed in all of the subsequent views
//The controllers array contains all the information about the subsequent view controllers that will be shown (nib files, navigation bar title, etc).
But when I use this in a sectioned/grouped tableview app, it returns the same thing for rows in different sections, i.e. rows 1 in sections 0,1 and 2 return the same thing.
I don't know how to make this work so that every single row, no matter the section shows will display a different view.
I suppose what I need some argument akin to the following line to return both row AND section number:
Code:
SecondLevelViewController *nextController = [self.controllers objectAtIndex:row];
But I don't know how to do that.