开发者社区 问答 正文

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

我可以获取一个点击按钮的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 1782 分享 版权
1 条回答
写回答
取消 提交回答
  • 既然你已经拿到了indexPath, 得到这个cell可以用下面的代码
    UITableViewCell *cell=[self.tableView cellForRowAtIndexPath:indexPath];

    2019-07-17 19:05:11
    赞同 展开评论
问答分类:
问答地址: