I'm getting the wrong height for an UITextView even I'm calculating its size like this:
CGRect requiredHeight = [self boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX)
options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading)
so, the answer es very obvious but not always we see things like that so easily!.
The answer is if we need to get the height for an specific field (it could be label, textView, etc) we should use a method from those fields to calculate its height, due to they could have some specific properties, if we calculate the height from a text (not considering the field) we are not considering those special properties the field could have.
So short answer, for
UITextView you should use
[textView sizeThatFits:] to get its height, it's probably the best way to do it if you are not using
I encourage you to use
autolayout if you can easily migrate your UI.