- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
if ([segue.identifier isEqualToString:@"toNext"]) {
NSIndexPath *selectedIndex= [self.mytableView indexPathForSelectedRow];
NSDictionary *myDic=(NSDictionary*)[nArray objectAtIndex:indexpath.section];
detailTableViewController *detailVC = [segue destinationViewController];
[detailVC setkMessageDict:(NSDictionary*)[[myDic objectForKey:@"locations"] objectAtIndex:selectedIndex.row]];
}
Please check your Array having the proper data from your section tableview otherwise add the NSDictionary
value to array and pass it to detailTableViewController
then try.Problem is your are not passing indexpath of section here.Hope its helpful for you.