我在stackoverflow上发现了一些类似的问题,但是它们不能解决我的问题。第一次旋转时,出现错误“ wait_fences:未能收到回复:10004003”,它将被阻塞一两秒钟,以便在新方向上打印新视图,我的代码如下:

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:    (NSTimeInterval)duration
{
    if (isLandScape) {
        [self toHorizontalBrowserView];
    } else {
        [self toVerticalBrowserView];
    }
}

- (void)toHorizontalBrowserView
{
    [horizontalBrowserViewController viewWillAppear:YES];
    [self.activeViewController viewWillDisappear:YES];
    [self.activeViewController.view removeFromSuperview];
    [_viewController.centerView insertSubview: horizontalBrowserViewController.view atIndex:0];
    [self.activeViewController viewDidDisappear:YES];
    [horizontalBrowserViewController viewDidAppear:YES];
    self.activeViewController = horizontalBrowserViewController;
}

- (void)toVerticalBrowserView
{
    [verticalPhotoBrowserViewController viewWillAppear:YES];
    [self.activeViewController viewWillDisappear:YES];
    [self.activeViewController.view removeFromSuperview];
    [_viewController.centerView insertSubview:verticalPhotoBrowserViewController.view atIndex:0];
    [self.activeViewController viewDidDisappear:YES];
    [verticalPhotoBrowserViewController viewDidAppear:YES];
    _activeViewController = verticalPhotoBrowserViewController;
}


这个问题是什么原因造成的?如何解决?

最佳答案

我以前有这个问题。我认为问题在于,您正在更新/更改视图堆栈,同时对其进行动画处理。尝试注释掉要删除和插入子视图的位。

关于iphone - 轮换:我收到错误“wait_fences:无法收到回复:10004003”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10792526/

10-13 03:48