本文主要是介绍iOS TableView didSelectRowAtIndexPath选中某Cell后获取其Cell实例对象,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在TableView上选中某个Cell会触发
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
-
- }
该方法的传入参数是“NSIndexPath”类型,如何获得对应的Cell对象吗,方法如下:
- - (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进行操作了。
这篇关于iOS TableView didSelectRowAtIndexPath选中某Cell后获取其Cell实例对象的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!