Reputation: 2978
.
Hi, everyone.
I have a custom ViewController(1) and presented another ViewController(2) modally. While Modal ViewController(2) is showing, it received memory warning and changed orientation. After then, I dismissed Modal ViewController(2).
And I checked the sequence of call back function on ViewController(1).
is it normal to be called willRotateToInterfaceOrientation function before loadView?
Upvotes: 0
Views: 253
Reputation: 84398
Is it normal? What does that matter? If your results are correct, willRotateToInterfaceOrientation is called first.
This is not a huge deal, however: if you need to access the view inside willRotateToInterfaceOrientation, just make sure to access [self view]
or self.view
in your code. If the view isn't already loaded, it will be loaded right then, calling loadView and viewDidLoad as necessary before returning control back to willRotateToInterfaceOrientation.
If you have outlets set up that are connected when the view loads (probable), just insert [self view];
at the top of the method to force the view to load and the outlets will be connected when it returns. Then you can call self.bigButton.enabled = NO;
or whatever else you'd like to do.
Upvotes: 1