【问题标题】:Unknown error [UIWindow endDisablingInterfaceAutorotation]未知错误 [UIWindow endDisablingInterfaceAutorotation]
【发布时间】:2011-01-23 00:57:07
【问题描述】:

我收到此错误。我不知道为什么会调用它,而且谷歌并没有真正提供帮助。有什么建议吗?

-[UIWindow endDisablingInterfaceAutorotation] called on <UIWindow: 0x4e0ec50; frame = (0 0; 320 480); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x4e0f9e0>> without matching -beginDisablingInterfaceAutorotation. Ignoring.

【问题讨论】:

    标签: iphone objective-c uikit uiwindow


    【解决方案1】:

    看来您必须先致电 -beginDisablingInterfaceAutorotation 而您没有这样做。

    【讨论】:

    • 我一开始没有调用这个方法,我已经读过需要先调用 beginMethod ,但这只是当你调用 end 的时候我没有,但我确实跟踪记录导致它的代码,[self showPurchase:purchase animated:YES];动画需要设置为 NO。问题是,当我第一次写这个时它没有抛出错误,直到我更改了 tableView 方法中的一些代码,由于多个部分,我需要使用 switch 语句,在只有 1 个部分之前,我仍在调查。
    【解决方案2】:

    我最近遇到了同样的问题。原来我不小心显示了同一个 UIActionSheet 两次。例如。

    [actionSheet showInView:aView];
    
    ... more code ...
    
    // WOOPS! I already did this
    [actionSheet showInView:aView];
    

    当 UIActionSheet 被解除(大约第 12 次,可能是 -beginDisablingInterfaceAutorotation 堆栈深度)时,它会导致错误。删除对 -showInView 的多余调用:修复了问题。

    【讨论】:

    • 我在微笑时遇到了同样的问题,我正在为 UICollectionViewCell 设置动画,并且它正在重新加载 1/2。
    【解决方案3】:

    将 UIViewAnimationOptionLayoutSubviews 添加到动画选项中解决了我的问题。

    【讨论】:

      【解决方案4】:

      我无缘无故地遇到了类似的问题。我的构建没有任何变化。我所要做的就是从我的测试设备中删除我的应用程序,重建并重新部署,这个问题就解决了。值得一试!

      【讨论】:

        【解决方案5】:

        在使用 UIViewControllerAnimatedTransitioning 类执行自定义 UIViewController 演示文稿时,我遇到了类似的问题。对我来说,打印输出如下所示:

        -[UIApplication endIgnoringInteractionEvents] called without matching -beginIgnoringInteractionEvents. Ignoring.
        -[UIWindow endDisablingInterfaceAutorotationAnimated:] called on <UIWindow: 0x7f9f83f42db0; frame = (0 0; 375 667); autoresize = W+H; gestureRecognizers = <NSArray: 0x7f9f83f44ed0>; layer = <UIWindowLayer: 0x7f9f83f40ca0>> without matching -beginDisablingInterfaceAutorotation. Ignoring.
        -[UIWindow endDisablingInterfaceAutorotationAnimated:] called on <UITextEffectsWindow: 0x7f9f862553a0; frame = (0 0; 375 667); opaque = NO; autoresize = W+H; layer = <UIWindowLayer: 0x7f9f83f9a1e0>> without matching -beginDisablingInterfaceAutorotation. Ignoring.
        

        我发现错误是由两次调用transitionContext.completeTransition(true) 引起的(一次在animateTransition(_:) 中,另一次在CAAnimation 委托animationDidStop(_:flag:) 方法中)。您可能需要检查您没有做类似的事情。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-08-30
          • 1970-01-01
          • 1970-01-01
          • 2020-11-18
          • 1970-01-01
          • 2017-03-16
          • 2021-09-06
          相关资源
          最近更新 更多