Crash in UIAlertviewController in IOS8.3

I used UIAlertView

but in IOS 8.3 I was changed to UIAlertViewController

Since UIAlertView

didn't work But UIAlertViewController

Failed with error

'UIApplicationInvalidInterfaceOrientation',
reason: 'Supported orientations has no common orientation with 
         the application, and 
         [ChartsTableViewController2_iPhone shouldAutorotate] is returning YES'

      

Not sure what to do, please help me.

+3


source to share


1 answer


Try to subclass UIAlertController and add this code. Hope it helps.



- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL) shouldAutorotate {
    return YES;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

      

+3


source







All Articles