I have a Custom Table View Cell that needs to pass a information to the heightForRowAtIndexPath method.
Each cell must answer what size it should have to heightForRowAtIndexPath method. How can I refer to that cell on specific indexPath and execute its getHeight method?
I used the [tableView dequeueReusableCellWithIdentifier:@"theCell" forIndexPath:indexPath];
but I get the error: "warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available." when I try do dequeue it.
Should I change my approach or is there a way to "ask" the cell which size it should have?
this is my Custom Cell getHeight method
-(CGFloat)getHeight{
if(isCardOpen){
//Calculate the size it should have based on its sub products
//returning a test value for validation only
return 253;
}
return 153;
}
this is my heightForRowAtIndexPath
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
CardCell *cell = (CardCell*)[tableView dequeueReusableCellWithIdentifier:@"theCell" forIndexPath:indexPath];
return [cell getHeight];
}