_viewControllerForSupportedInterfaceOrientationsWithDismissCheck Unrecognized selector

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;
}
+4
source share
2 answers

I also saw a similar crash in iOS 8 when you present the Modal View Controller from the UIActionSheet and you reject the Modal View Controller and rotate the screen.

, . ,

Modal View actionSheet: clickedButtonAtIndex: UIActionSheet, "actionSheet didDismissWithButtonIndex:" .

+4

iOS8, , , .

ActionSheet: clickedButtonAtIndex: method. , , , , , , .. [self performSelector:@selector(presentModalViewController) withObject:nil afterDelay:1.0];

, , , .

+2

All Articles