Huang
Huang

Reputation: 1355

iOS, orientationchanges, fires in iOS 5 but not in iOS 6

I have an app that presents a UIWebview modally using presentViewController. Now the root view supports orientation changes and rotates accordingly. I listen to the event UIApplicationWillChangeStatusBarOrientationNotification.

Now I present the modal window using "

                 presentViewController:navController
                  animated:YES
                completion:nil];

I dismiss using

                dismissModalViewControllerAnimated:YES];

now to the issue : in iOS 6, this works fine and the modal window shows up in whatever orientation its parent was in.

in iOS 5 , the presentViewController or dismissModalViewControllerAnimated forcibly throws

UIApplicationWillChangeStatusBarOrientationNotification!!

Any ideas why?

Upvotes: 0

Views: 109

Answers (1)

Tommy Devoy
Tommy Devoy

Reputation: 13549

Try using this orientation notification instead:

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:)
 name:UIDeviceOrientationDidChangeNotification object:[UIDevice currentDevice]];

Upvotes: 3

Related Questions