I can't get this dynamic label to resize its height according to the content. It logs the correct info but the label is always the same height. Any ideas? (code based on this answer)
self.descriptionLabel.text = string;
self.descriptionLabel.adjustsFontSizeToFitWidth = YES;
self.descriptionLabel.numberOfLines=0;
CGSize maximumLabelSize = CGSizeMake(296,9999);
CGSize expectedLabelSize = [string sizeWithFont:[UIFont fontWithName:@"Helvetica" size:14] constrainedToSize:maximumLabelSize lineBreakMode:NSLineBreakByWordWrapping];
//adjust the label the the new height.
CGRect newFrame = self.descriptionLabel.frame;
newFrame.size.height = expectedLabelSize.height;
NSLog(@"the height %f", newFrame.size.height);
self.descriptionLabel.frame = newFrame;