找到你要的答案

Q:Unknown error [UIWindow endDisablingInterfaceAutorotation]

Q:未知错误[ UIWindow enddisablinginterfaceautorotation ]

I am receiving this error. I have no clue as to why it would be called, and Google didn't really help. Any suggestions?

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

我收到这个错误。我不知道为什么会被调用,而谷歌并没有真正的帮助。有什么建议吗?

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

Looks like you have to call -beginDisablingInterfaceAutorotation first and you're not doing that.

看起来你有电话begindisablinginterfaceautorotation第一你不这样做。

answer2: 回答2:

I recently had the same problem. It turned out that I was accidentally displaying the same UIActionSheet twice. eg.

[actionSheet showInView:aView];

... more code ...

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

When the UIActionSheet gets dismissed (for about the 12th time, probably the -beginDisablingInterfaceAutorotation stack depth) it caused the error. Removing the redundant call to -showInView: fixed the problem.

我最近也有同样的问题。原来,我是无意中显示相同的UIActionSheet两次。如.

[actionSheet showInView:aView];

... more code ...

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

当被解雇(UIActionSheet的大约第十二的时间,可能的begindisablinginterfaceautorotation堆栈深度)引起的误差。去除多余的给showinview:固定的问题。

answer3: 回答3:

I've had a similar issue when performing a custom UIViewController presentation using a UIViewControllerAnimatedTransitioning class. For me, the printouts looked like the following:

-[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.

I found out that the error was caused by calling transitionContext.completeTransition(true) twice (once in animateTransition(_:), and another in a CAAnimation delegate animationDidStop(_:flag:) method). You might want to check that you aren't doing something similar.

我有一个类似的问题在执行自定义处理演示使用uiviewcontrolleranimatedtransitioning类。对我来说,看起来像下面的打印输出:

-[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引起的。完整的过渡(真正的)两次(一次是在animatetransition(_:),另一caanimation代表animationdidstop(_:国旗:)方法)。你可能想检查你没有做类似的事情。

answer4: 回答4:

Adding UIViewAnimationOptionLayoutSubviews into the animation options solved my problem.

添加uiviewanimationoptionlayoutsubviews进入动画选项解决了我的问题。

answer5: 回答5:

I ran into a similar issue for no reason. Nothing had changed in my build. All I had to do was remove my application from my testing device, rebuild and redeploy and this issue was solved. Worth a shot!

我无缘无故地碰到了类似的问题。我的建筑没有改变。我所要做的就是从我的测试装置,我的应用程序,重建和重新部署,这样问题就解决了。值得一试!

iphone  objective-c  uikit  uiwindow