ios tableview didSelectRowAtIndexPath方法中,获取某个cell的实例

来源:互联网 发布:中控考勤机数据库修改 编辑:程序博客网 时间:2024/05/29 16:53


选中tableView的某一行,触发如下方法:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

}


若此时需要对tableview的cell做处理,就需要先得到改行cell对应的实例,可运用如下方法: 

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

或者某个自定义cell

MyCustomCell *cell = (MyCustomCell *)[tableView cellForRowAtIndexPath:indexPath];

    


0 0
原创粉丝点击