gpt4 book ai didi

ios - 将数据从自定义表格 View 单元格传递到 UIView Controller

转载 作者:行者123 更新时间:2023-12-01 19:52:48 24 4
gpt4 key购买 nike

我正在关注这个 [blog][1],用于将数据从表格 View 中的自定义单元格传递到 View Controller 。自定义单元格正在从响应中获取数据,我必须在自定义单元格中显示其中的一些数据,而在详细 View Controller 中显示其余数据。任何人都可以确定我的代码中实际问题出在哪里吗?从 segue 传递数据。

    - (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];

}
}

这是我单击单元格时遇到的错误。

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key id.' First throw call stack:



这是我的 ShowViewcontroller.h文件。

更改代码。

enter image description here

最佳答案

您可能已经删除了您的 outlet来自 storyboard 的连接给您的ViewController请检查您的 socket 是否连接正确。 ⚠️

enter image description here

必须有 id在您的 showViewController 中首先创建并由您删除的属性

关于ios - 将数据从自定义表格 View 单元格传递到 UIView Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44882783/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com