【问题标题】:Rotation: I receive the error "wait_fences: failed to receive reply: 10004003"轮换:我收到错误“wait_fences:未能收到回复:10004003”
【发布时间】:2012-05-29 02:47:33
【问题描述】:

我在stackoverflow上发现了一些类似的问题,但它们不能解决我的问题。第一次做旋转时,收到错误“wait_fences: failed to receive reply: 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;
}

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

【问题讨论】:

  • 您不需要自己调用 viewWillAppear: 和 viewWillDisappear: 方法
  • 我试过了,但没有解决我的问题

标签: iphone objective-c ipad rotation


【解决方案1】:

我过去遇到过这个问题。我认为问题在于您在动画时正在更新/更改视图堆栈。尝试注释掉要删除和插入子视图的位。

【讨论】:

    猜你喜欢
    • 2023-03-22
    • 2011-05-02
    • 2010-11-25
    • 1970-01-01
    • 1970-01-01
    • 2010-11-29
    • 2011-02-05
    • 1970-01-01
    • 2011-05-13
    相关资源
    最近更新 更多