如何通過CustomCell中的自定義單元格獲取tableView?如何通過自定義單元格獲取tableView?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CustomCell" forIndexPath:indexPath];
return cell;
}
@implementation CustomCell
- (void)awakeFromNib {
[super awakeFromNib];
// How do I get tableView by custom cell in the CustomCell?
}
@end
沒有理由讓單元訪問它所在的表。請解釋爲什麼你認爲你需要這個。可能有更好的解決方案。 – rmaddy
有詳細頁面,使用不同的單元格。有兩個視圖的標籤視圖,我通常在其中添加兩個控制器。所以我必須讓超級視圖控制器添加子控制器。我不知道我的描述,我的英文不好: - ) –