如何获取点击的UITableView的cell的内容

2025-05-09 16:45:22
推荐回答(2个)
回答1:

一般的话- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 这个方法里应该都会设置cell内的显示内容,在didselect里面你把上面那个方法里的[xxxx objectAtIndex:indexPath.row] xxxxx]再次赋给你自己要取指的对象不就可以了么

回答2:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
方法里 设置UITableViewCell *cell = [table cellForRowAtIndexPath:indexPath]; 然后获取cell属性里面的内容