因此,当我输入下面的 if 语句时,我收到了 EXC Bad Access 错误。令人沮丧的是,我已经确认 indexPath 和 tableView 指向正确的位置。此外,完全相同的 if 语句在同一实现文件中我的代码的其他地方使用,没有错误。
非常感谢您的帮助。
-(CGFloat)tableView:(UITableView *)tableView
heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if([indexPath row] == ([tableView numberOfRowsInSection:[indexPath section]]-1))
{
return 44.0;
} else {
return 60.0;
}
}
最佳答案
if([indexPath row] == ([tableView numberOfRowsInSection:[indexPath section]-1]))
{
return 44.0;
} else {
return 60.0;
}
关于ios - indexPath 处 Row 的高度抛出 EXC Bad Access 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10958561/