0

I am using a CGFloat value to set my scrollView's contentSize so that it adjusts dynamically to content populated in my textviews. I determine the heights of each text view and their positions in the viewDidLoad method, but have to set the scrollView height in the viewWillAppear method - otherwise the contentSize isn't correct and the scrollView won't scroll. The problem is, the CGFloat value isn't accessible in the viewWillAppear method.

How can I pass that value between the two methods?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Rooncicle
  • 106
  • 1
  • 11

1 Answers1

0

You need to make private ivar in .m file to use it as cache between methods in you class.

@implementation YOUR_CLASS_NAME 
{ 
    CGFloat _height; 
} 
malex
  • 9,874
  • 3
  • 56
  • 77