2011-06-02 83 views
0

我想知道当我们选择第一张表格的行时,如何更改第二张表格的cell.textLabel.text .. PS :两个表都在同一个视图..所以我不能推另一个视图控制器来掩盖当前视图。在第二张表中选择第一张表中的第一张表格时,在第二张表格中更改表格数据

示例:我在第一个表中有大约10行数据,在选择表1中的第一行时,它应该在第二个表的第一行中显示“table1,row1”或任何其他字符串..我选择的第一个表格的第二行..,第二个表格的第一行现在应该显示为“表1,2行”提前

感谢

回答

0
Try something likethis....  
Have a string NSString *str=[[NSString alloc]init]; 

    for the first table 


     didSelectRowAtindexPath 
      { 
      if(indexpath.row==1) 
      [email protected]"1 row 1 table"; 
      if(indexpath.row==2) 
      [email protected]"2 row 1 table"); 
      [table2 reloadData]; 
      } 
     In table2 
     cellforRowAtindexPath 
     { 
     cell.textLabel.text=str; 
     }