I really confused about a experience I’ve made today. I was calculating the cell height.
This is the code:
float height = [text sizeWithFont:[UIFont systemFontOfSize:17.0f] constrainedToSize:CGSizeMake(300 - width - 20.0, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap].height;
Now the thing is, when I change the …systemFontOfSize:17.0f to …systemFontOfSize:17.0, so without “f” it calculate a wrong height.
My question is more about what this “f” stands for and what it does.
It tells the computer that this is a floating point number. If there is no f after the number, it is considered a double or an integer (depending on if there is a decimal or not).