I present the image on the controller of the final view (portait), at the point everything is on the screen, if I rotate the device’s landscape and landscape landscape, all the same everything is fine,
IF I then use the SLComposeViewController (for posting on Twitter), as soon as I reject it (cancel or post something), then rotate the phone’s landscape, the application will exit with the following error:
* Application termination due to the uncaught exception "NSInvalidArgumentException", reason: "- [_ UIAppearanceCustomizableClassInfo _viewControllerForSupportedInterfaceOrientationsWithDismissCheck:]: unrecognized selector sent to instance 0x1b9eefd0 ''
While I do not use landscape mode, the application rotates when I rotate it in landscape orientation, but this is not the main problem, the problem is the application crashes.
So far, I know that it will be good if the user does not change the phone after posting on Twitter, this is not ideal, and something that I would prefer to fix, since I'm sure you agree.
Regarding orientation support, AppDelegate.m has this:
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
return UIInterfaceOrientationMaskLandscape|UIInterfaceOrientationMaskPortrait |UIInterfaceOrientationMaskPortraitUpsideDown;
}
And the controller that has the alarm has this:
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
NSString *viewControllerClassName = [NSString stringWithUTF8String:object_getClassName(window.rootViewController)];
if ([viewControllerClassName isEqualToString:@"_UIAlertShimPresentingViewController"]) {
return UIInterfaceOrientationMaskPortrait;
}
else {
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}
}
-(BOOL)shouldAutorotate{
return NO;
}