我有一个UITableView是由一些自定义的UITableViewCells。
当 tabledidSelectRowAtIndexPath方法触发时,如果indexPath.row等于 2,我想UILabel在这一行的单元格中更新 a。
我的想法是按照以下思路使用一些东西;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.row == 2){
myCustomCellView *cell = [self.essentialsTableView cellForRowAtIndexPath:indexPath];
cell.myUILabel.text = @"my text";
[tableView reloadData];
}
}
这里的问题是cellForRowAtIndexPath返回一个类型的对象UITableViewCell,而不是myCustomCellView。
谁能建议我如何访问和更新didSelectRowAtIndexPath方法中的单元格属性?