0

I have two view controllers. I display the 1st one and then when I modally display the second one viewDidAppear gets called from the View Controller 1 after viewDidAppear gets executed from View Controller 2.

Why is View Controller 1's viewDidAppear getting called while in View Controller 2? Is this normal behavior?

More importantly the content view of a scrollview is getting resized when the viewDidAppear gets from the View Controller 1 gets called inside View Controller 2.

Ephemera
  • 8,672
  • 8
  • 44
  • 84
Ben Coffman
  • 1,750
  • 1
  • 18
  • 26
  • Would ViewController2 happen to extend ViewController1? – groomsy Feb 28 '13 at 23:09
  • Good thought, but no it does not, unless there is some way to do that in IB that I don't know of and I missed it from another developer? – Ben Coffman Feb 28 '13 at 23:11
  • You can verify which Class your .xib's ViewController is pointing to. Open the .xib, select File's Owner, then open the Identity Inspector (right column or 'Utilities' column) and look at the Class that it's pointing to. Verify that it's pointing to the correct view controller. – groomsy Feb 28 '13 at 23:14
  • It is and I'm using Storyboards. It appears it is behaving as it should, apparently the ViewDidAppear does get called for the controller you are about to show before the viewDidDisappear gets executed on the current controller. Which makes sense when I think about it. Still not sure about the resize, but not relevant to this question. – Ben Coffman Feb 28 '13 at 23:21

0 Answers0