textView.layoutManager.allowsNonContiguousLayout = NO;
CGPoint pt = [textView caretRectForPosition:self.textView.selectedTextRange.start].origin;
[textView setContentSize:CGSizeMake(0, pt.y + textView.font.pointSize)];
textView.layoutManager.allowsNonContiguousLayout = NO;
CGPoint pt = [textView caretRectForPosition:self.textView.selectedTextRange.start].origin;
[textView setContentSize:CGSizeMake(0, pt.y + textView.font.pointSize)];