Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/114.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UITableViewCell数据应加载到其他ViewController_Ios_Tableview - Fatal编程技术网

Ios UITableViewCell数据应加载到其他ViewController

Ios UITableViewCell数据应加载到其他ViewController,ios,tableview,Ios,Tableview,我正在应用程序中使用TableViewCell。以及在特定的细胞中,来自imageview的标签文本和图像等细胞数据。应在下一个视图控制器中查看 -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { MainBodyViewController * mainViewController =[[MainBodyViewController alloc]init

我正在应用程序中使用TableViewCell。以及在特定的细胞中,来自imageview的标签文本和图像等细胞数据。应在下一个视图控制器中查看

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    MainBodyViewController * mainViewController =[[MainBodyViewController alloc]init];
    MasterDetails * masted =(MasterDetails*)[listArray objectAtIndex:indexPath.row];
    NSLog(@"did select row at index is givne as:%@",masted);
    mainViewController.headLbl.text=[NSString stringWithFormat:@"%@",masted.title];
}
但问题是我没有从listArray获取数据。数据来自json。

您需要检查

  • 表视图行数应为[listarry count],以避免超出 索引
  • 根据cell==json解析对象的编号,正确创建“MasterDetails”对象
  • 已分配“listarray”

  • 对我想像这样传递细胞数据。为选定的特定单元格标记文本和图像。选定的单元格数据应显示在标签和文本上的下一个viewcontroller中。显示您的tableview委派方法委派方法和数据源相同。我的意思是我们使用它作为委托方法和数据源作为self我检查了它,我正在使用这些方法,但如果我使用这些方法,我会得到错误。如果你得到任何,那么请给我发一个链接。你检查过这个。。。