当我进入下面的 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;
}
}