I have this method in my MainViewController:
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { NSLog(@"MAIN CONTAINER WILL ANIMATE"); [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation duration:duration]; }
And when I spin, NSLog appears, and everything is perfect. However, if I present a modalViewController from my MainViewController and then rotate, the NSLog no longer appears and my MainViewController never knows that the device has rotated, so when the modalView is fired, the interface is not configured to rotate.
Any ideas on why a modal view might prevent parents from receiving rotation updates? Is this typical, or is something wrong with my setup?
And just to make sure, I tried to present modalViewController as a subview via [mainViewController.view addSubview:modalView.view] , and rotation updates took effect properly. This only happens when I do [mainViewController presentModalViewController:modalViewController]; that updates do not take effect.
ios objective-c iphone
Snowman
source share