views:

88

answers:

1

Hi, My view controller is not responding to didRotateFromInterfaceOrientation, despite that I have added following in my code:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    [self.popOver dismissPopoverAnimated:NO];
    if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
    ... My Custom Code...   
    }
}

Am I doing something wrong here?

A: 

If you can't inherit from UIViewController (which is unfortunate), you can use this:

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

Then register to start receiving UIDeviceOrientationDidChangeNotification notifications.

Robot K
Excellent. Thanks.
Abhinav