开发者社区> 问答> 正文

知道索引路径后获取详细信息

我可以获取一个点击按钮的cell的索引路径,

- (IBAction)buttonWasPressed:(id)sender
{
    CGPoint buttonPosition = [sender convertPoint:CGPointZero toView:self.tableView];
    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:buttonPosition]; 
}

现在我想访问cell的属性,应该怎么实现?类似

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

展开
收起
爵霸 2016-03-17 13:23:32 1708 0
1 条回答
写回答
取消 提交回答
  • 既然你已经拿到了indexPath, 得到这个cell可以用下面的代码
    UITableViewCell *cell=[self.tableView cellForRowAtIndexPath:indexPath];

    2019-07-17 19:05:11
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载