Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/108.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS 5中手动旋转后的应用程序冻结_Ios_Rotation - Fatal编程技术网

iOS 5中手动旋转后的应用程序冻结

iOS 5中手动旋转后的应用程序冻结,ios,rotation,Ios,Rotation,所以我有一个错误。在用户单击“解锁旋转”按钮后,当我尝试旋转应用程序时,会出现此消息。对于此功能,我使用下一个代码 RotateHelperViewController *viewController = [[RotateHelperViewController alloc] init]; viewController.neededOrientation = currentDeviceOrientation; self.orientationFromLockedState

所以我有一个错误。在用户单击“解锁旋转”按钮后,当我尝试旋转应用程序时,会出现此消息。对于此功能,我使用下一个代码

    RotateHelperViewController *viewController = [[RotateHelperViewController alloc] init];
    viewController.neededOrientation = currentDeviceOrientation;
    self.orientationFromLockedState = currentDeviceOrientation;
    [UIView animateWithDuration:0.4 animations:^{
        [self presentModalViewController:viewController animated:NO];
        }
        completion:^(BOOL finished) {
            [viewController dismissModalViewControllerAnimated:NO];
            [viewController release];
            self.orientationFromLockedState = -1;
        }];

这个bug只出现在ios 5.x和ios 6.x上,一切正常。如果我们自动旋转,旋转效果也很好

问题通过使用[UIViewController attemptRotationToDeviceOrientation]解决。如果我们尝试支持iOS 4.3,这将不起作用。谢谢。问题通过使用[UIViewController attemptRotationToDeviceOrientation]解决。如果我们尝试支持iOS 4.3,这将不起作用