我正在使用原型單元格來計算實際單元格高度。由於我正在使用故事板,因此我選擇通過取出它來創建原型單元格。示例代碼:我可以安全使用dequed tableView單元格作爲原型
- (MyCell *)prototypePriceOptionCell
{
if (_prototypeCell == nil) {
_prototypeCell = (MyCell *)[self.tableView dequeueReusableCellWithIdentifier:cellIdentifier];
}
return _prototypePriceOptionCell;
}
該原型永遠不會在cellForRowAtIndexPath
方法返回到tableView
。
是否可以通過表視圖重新使用並在表視圖中顯示它?