1、如果是在TableView的代理方法
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
中獲取,可以直接用
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
2、如果是在自定義TableViewCell的公有方法里獲取,要知道row和section,如下:
-(void)getExampleOfCellWithIndex:(NSInteger)index{
NSIndexPath *path = [NSIndexPath indexPathForRow:0 inSection:0];
UITableViewCell *cell = (UITableVIewCell *)[tableView cellForRowAtIndexPath:path];
}