Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAlertviewController crashes in IOS8.3

I was using UIAlertView but In IOS 8.3 i changed to UIAlertViewController Because UIAlertview was not working But UIAlertViewController Crash with the error

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

Don't know what to do please help me.

like image 329
Syed Muhammad Hassan Avatar asked Apr 07 '26 13:04

Syed Muhammad Hassan


1 Answers

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

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL) shouldAutorotate {
    return YES;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}
like image 152
Nuzhdin Vladimir Avatar answered Apr 10 '26 03:04

Nuzhdin Vladimir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!