我正在使用该方法tableView:indexPathForCell来实现自定义委托,该委托可以UITableViewCell根据其UIWebView内部的框架大小动态调整大小.问题是当我试图找出特定单元格的indexPath是什么时tableView:indexPathForCell返回nil:
- (void)trialSummaryTableViewCell:(TrialSummaryTableViewCell *)cell shouldAssignHeight:(CGFloat)newHeight {
NSIndexPath *indexPath = [tableV indexPathForCell:cell];
NSLog(@"tableV: %@\ncell: %@\nindexPath: %@", tableV, cell, indexPath); //<--
// ...
}
Run Code Online (Sandbox Code Playgroud)
这里,tableV不返回nil,单元格不返回nil,但indexPath返回nil.
我究竟做错了什么?
编辑:我-(void)trialSummaryTableViewCell从该tableView:cellForRowAtIndexPath:方法调用