I have a view controller with several tables. I want one table to have larger cells than the others. Right now, I have:
- (CGFloat *)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tableView != myBigTable)
{
return 44;
}
else
{
return 88;
}
}
I get a warning saying
Incompatible integer to pointer conversion returning ‘int’ from a
function with result type ‘CGFloat *’ (aka ‘float *’)
and when I run it, it crashes.
I’ve also tried:
return 44.0– error for double to float* conversionreturn 44.0f– error for float to float* conversionCGFloat *height; height = 44; return height;– same errors as just returning the value I want directly
I’ve looked for something like [CGFloat floatWithDouble:44.0]; as is done with an NSNumber, but I haven’t found anything. What am I supposed to be using?
Your function declaration is wrong. It must be
The return type is
CGFloatand notCGFloat *.