I\'ve seen this happen whenever i rotate a screen that has a UITableView
on it. I\'ve found out that it happens inbetween the willRotate
and
I had this problem when i was assumed that:
tableView:heightForHeaderInSection:
returned an NSInteger
, but it returns CGFloat
...
changing:
-(NSInteger)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
to
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
fixed my issue.
Edit:
At some point I figured out how computers work below the C level, so I thought I would share it... (I will use an register names from x86_64 as I am most familiar with them, ARM would be slightly different but analogous)
int f(){
float someFloat=5.0f;
return someFloat;
}
results in converting the value of someFloat
to an integer type then copying that to a particular register: %rax
then calling the return instruction.
float f(){
float someFloat=5.0f;
return someFloat;
}
results in copying the value of someFloat
from its current location to a particular register: %xmm0
then calling the return instruction.
So if you have the wrong prototype the calling code will expect the value to be in the wrong place, you will end up really returning a garbage value.