-1

I am using TableViewCell in my application. and the cell data like label text and image from imageview at perticular cell. should view in next view controller.

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

But the problem is I am not getting data from listArray. The data coming from json.

itsji10dra
  • 4,603
  • 3
  • 39
  • 59

1 Answers1

0

You need to check

  1. Table view No of rows should be [listarry count] to avoid out of index.
  2. "MasterDetails" object is created properly, as per no of cell == json parsed object.
  3. "listarray" is allocated.
Hot Licks
  • 47,103
  • 17
  • 93
  • 151
iOSarang
  • 11
  • 6