我以下这个[博客] [1],用于在表视图从自定义单元格将数据传递到一个视图控制器。自定义单元格正在从响应中获取数据,我必须在“自定义单元格”和“详细信息视图控制器”中的其余数据中显示它。任何人都可以确定实际问题出现在我的代码中吗?传递来自segue的数据。从定制的tableview细胞将数据传递到控制器的UIView
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"ShowDetail"]) {
//Do something
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
ShowViewController *destViewController = segue.destinationViewController;
destViewController.tites = [_Title objectAtIndex:indexPath.row];
destViewController.prce = [_Price objectAtIndex:indexPath.row];
destViewController.ara = [_LandArea objectAtIndex:indexPath.row];
destViewController.phon = [_Phone objectAtIndex:indexPath.row];
destViewController.citi = [_City objectAtIndex:indexPath.row];
destViewController.loc = [_location objectAtIndex:indexPath.row];
destViewController.tye = [_type objectAtIndex:indexPath.row];
destViewController.Idss = [_Id objectAtIndex:indexPath.row];
destViewController.nam = [_name objectAtIndex:indexPath.row];
destViewController.emal = [_email objectAtIndex:indexPath.row];
destViewController.roomss = [_rooms objectAtIndex:indexPath.row];
destViewController.wash = [_washroom objectAtIndex:indexPath.row];
destViewController.flloors = [_floor objectAtIndex:indexPath.row];
destViewController.stat = [_status objectAtIndex:indexPath.row];
destViewController.descrp = [_descrip objectAtIndex:indexPath.row];
destViewController.countryy = [_country objectAtIndex:indexPath.row];
}
}
这是我在单击单元格时遇到的错误。
终止应用程序由于未捕获的异常 'NSUnknownKeyException', 原因: '[ 的setValue:forUndefinedKey:]:此类不是密钥值 编码兼容的密钥ID。'首先掷出调用堆栈:
这是我的ShowViewcontroller.h文件。
改变代码。在ShowViewController
什么是你的电流输出? –
你如何在ShowViewController中声明Idss? –
随机给予访问值的名称。 @AravindAR –