2017-07-03 63 views
1

我以下这个[博客] [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

enter image description here

+0

什么是你的电流输出? –

+0

你如何在ShowViewController中声明Idss? –

+0

随机给予访问值的名称。 @AravindAR –

回答

2

你可能已经删除您outlet连接您ViewController 请检查您的插座正确或不连接。 ⚠️

enter image description here

必须有一个id财产首先创建和删除,在你showViewController

+0

它现在向我显示此错误, - [StringData length]:无法识别选择器发送到实例0x608000138b00 2017-07-03 15:41:20.922 PK.House [10411:854053] ***因未捕获异常'NSInvalidArgumentException'而终止应用程序,原因:' - [StringData length]:无法识别的选择器已发送到实例0x608000138b00' –

+0

'ShowViewController'在此显示你的代码,你现在可以检查你的ViewDidLoad正在调用你的'ShowViewController' – Dhiru

0

检查属性,因为destViewController.Idss(颜色显示错误)

@property(nonatomic,strong) NSString *Idss; // Make as this and 
@synthesize Idss 

,改变[_id objectAtIndex:indexPath.row] //替换_id数组名与另一名

+0

更改后出现同样的错误@ Lalit kumar –

+0

显示您的更改代码 –

+0

我编辑了我的问题并添加了屏幕截图,查看它。@ Lalit kumar –

相关问题