0

Have a view controller with a UIScrollView. This view controller is created / loaded at the start of the app. Before the controller is ever seen, trying to add subviews to the scrollview and the scrollview will not accept / add the sub views. Once the ViewWillAppear is called, then can add subviews fine. It runs the exact same code, but will not add the subviews until it has been called to view once.

What are the reasons for this? I assume this is as designed....

Marc
  • 16,170
  • 20
  • 76
  • 119
ort11
  • 3,359
  • 4
  • 36
  • 69

1 Answers1

0

You should be able to insert your subviews during viewDidLoad: if the controller's view outlets are all OK. (That's a bit earlier than viewWillAppear: and is the spot where a valid view object should first be available.)

Phillip Mills
  • 30,888
  • 4
  • 42
  • 57
  • There are no errors and frames are all setup ok, but simple are not there. They don't get added to the subviews. I will have to workup a test bench to double check this. – ort11 Apr 17 '12 at 14:34
  • Is that happening in viewDidLoad? (Try logging the value of your scroll view.) – Phillip Mills Apr 17 '12 at 14:59