我在最终视图控制器(portait)上呈现图像,在屏幕上显示所有内容,如果我打开设备环境,然后landscaperight,它仍然可以;_viewControllerForSupportedInterfaceOrientationsWithDismissCheck无法识别的选择器
如果我然后使用SLComposeViewController(用于Twitter发布)一旦我驳回(取消或发布的东西),然后旋转手机风景,应用程序崩溃,出现以下错误;
*终止应用程序由于未捕获的异常 'NSInvalidArgumentException' 的,理由是: ' - [_ UIAppearanceCustomizableClassInfo _viewControllerForSupportedInterfaceOrientationsWithDismissCheck:]:无法识别的选择发送到实例0x1b9eefd0'
虽然我不使用风景模式下,当我将其转向横向时,应用程序确实会转向,但这不是主要问题,问题在于应用程序崩溃。
虽然我知道如果用户在发布到Twitter之后没有打开手机,这并不理想,而且我宁愿修复,因为我确信您同意。
关于方向支持,AppDelegate.m有这个;
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
return UIInterfaceOrientationMaskLandscape|UIInterfaceOrientationMaskPortrait |UIInterfaceOrientationMaskPortraitUpsideDown;
}
而且崩溃的控制器有这个;
-(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;
}
我有类似的异常:***终止应用程序由于未捕获的异常 'NSInvalidArgumentException',原因是: ' - [NSConcreteValue _viewControllerForSupportedInterfaceOrientationsWithDismissCheck:]:无法识别的选择发送到实例0x17e40260' ..(( – gmlvsv 2014-09-30 13:56:19