码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2015-08-13 22:16:26      阅读:400      评论:0      收藏:0      [点我收藏+]

标签:ios   uitableviewcell   didselectrowatindexp   cell   


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

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

{

}


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

UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];

或者某个自定义cell

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

    


版权声明:本文为博主原创文章,未经博主允许不得转载。

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

标签:ios   uitableviewcell   didselectrowatindexp   cell   

原文地址:http://blog.csdn.net/lijuan3203/article/details/47621969

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!