您的位置:首页 > 移动开发 > IOS开发

iOS TableView didSelectRowAtIndexPath选中某Cell后获取其Cell实例对象

2017-03-07 14:48 465 查看
在TableView上选中某个Cell会触发

[cpp] view
plain copy

 





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

      

}  

该方法的传入参数是“NSIndexPath”类型,如何获得对应的Cell对象吗,方法如下:

[cpp] view
plain copy

 





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

   <span style="font-family: Consolas, 'Courier New', Courier, mono, serif; line-height: 18px;">UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; </span>   

}  

之后就可以对相应的Cell进行操作了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: