After much searching here on SO, I have yet to find a solution which doesn't appear to be an argument of opinion. Previously in code, I could achieve my desired result with the below code (long route yes...)
if(indexPath.section == 0 && indexPath.row == 0) {
DetailViewController *dvc = [[[DetailViewController alloc] init] autorelease];
dvc.detail = data.city1;
[self.navigationController pushViewController:dvc animated:YES];
}
if(indexPath.section == 0 && indexPath.row == 1) {
DetailViewController *dvc = [[[DetailViewController alloc] init] autorelease];
dvc.detail = data.city2;
[self.navigationController pushViewController:dvc animated:YES];
and so on, providing each cell a specific action to execute upon selection and pass an array to the next view. All of my research is looking like a difference of style and opinion mixed with inconsistencies between hooking segue to the view controller or tot a specific cell and which method to use between didSelectRow or prepareForSegue. The following code is hooked to a cell in storyboard, so each cell in that section now passes the same data to the next tableview.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"shows"])
{
ShowsList *viewController = segue.destinationViewController;
viewController.detail = data.city1;
}
}
My question is how to handle indexPath.row in prepareForSegue to achieve what I could previously do in code and pass a specific array depending on which row is chosen? Ive tried reverting to a mix of storyboard and code which is a failure, creating multiple custom cells which seems to defeat the whole purpose of a "no mess" approach, and multiple variations of different answers. Again, how would I say "Hey, when this is chosen pass this info, when this is chosen pass this info...?" using the prepareForSegue method