Application crashes on trying to access [tableView cellForRowAtIndexPath:indexPath] in the heightForRowAtIndexPath delegate method.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([tableView cellForRowAtIndexPath:indexPath] someBOOLProperty]) {
return kSomeHeight;
}
return kDefaultHeight;
}
We do not have
tableViewCellobject at the time above method is called.I think using [
tableView cellForRowAtIndexPath:indexPath] inside the above delegate is not correct.