I use the following code to dynamically resize labels:
CGRect frame = self.myLabel2.frame;
frame.origin.y = self.myLabel1.frame.origin.y + self.myLabel1.frame.size.height + 10;
frame.size = LABEL_SIZE(self.myLabel2);
self.myLabel2.frame = frame;
Where LABEL_SIZE
is a macro defined as :
#define LABEL_SIZE(label) CGSizeMake(280, [label sizeThatFits:CGSizeMake(280, FLT_MAX)].height);
The code works absolutely fine when run on simulator (32-bit). The problem arises when running on simulator (64-bit). XCode shows it not as a warning, but as an error, due to which, it will not even compile.
I do not understand, am I missing something?