我希望有人可以帮助我。我在这里做错了。我试图找到详细视图。问题是我第一次选择它时,它返回一个nil值,第二个,第三个等时间它返回我之前选择的值。
我希望有人可以帮助我。
提前多多感谢。
问候,
jaco
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSInteger section = [indexPath section];
NSArray *HS = [sect objectForKey:[alles objectAtIndex:section]];
passString = [HS objectAtIndex:indexPath.row];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
SiTDetailViewController *vcTarget = [segue destinationViewController];
vcTarget.mijnString = passString;
}
答案 0 :(得分:0)
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
NSIndexPath *path = [self.tableView indexPathForSelectedRow];
NSArray *HS = [sect objectForKey:[alles objectAtIndex:path.section]];
passString = [HS objectAtIndex:path.row];
SiTDetailViewController *vcTarget = [segue destinationViewController];
vcTarget.mijnString = passString;
}