【问题标题】:ios8 crash on _updateInterfaceOrientationFromDeviceOrientationios8 在从 DeviceOrientation 更新 InterfaceOrientation 时崩溃
【发布时间】:2014-09-23 18:09:04
【问题描述】:

在我的日志服务中遇到了很多这样的崩溃。有什么提示吗?我的应用只支持纵向模式。

线程:崩溃:com.apple.main-thread

0  libobjc.A.dylib                0x32bfbf46 objc_msgSend + 5
1  UIKit                          0x289ba531 -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 152
2  CoreFoundation                 0x254d44a1 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
3  CoreFoundation                 0x2543093d _CFXNotificationPost + 1784
4  Foundation                     0x261609b9 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
5  UIKit                          0x289ba2f3 -[UIDevice setOrientation:animated:] + 318
6  UIKit                          0x289ba0a3 -[UIApplication handleEvent:withNewEvent:] + 1566
7  UIKit                          0x289b99c1 -[UIApplication sendEvent:] + 72
8  UIKit                          0x28a1e801 _UIApplicationHandleEvent + 632
9  GraphicsServices               0x2c79d679 _PurpleEventCallback + 528
10 GraphicsServices               0x2c79d2c3 PurpleEventCallback + 34
11 CoreFoundation                 0x254e1dab __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
12 CoreFoundation                 0x254e1d47 __CFRunLoopDoSource1 + 346
13 CoreFoundation                 0x254e0349 __CFRunLoopRun + 1608
14 CoreFoundation                 0x2542e621 CFRunLoopRunSpecific + 476
15 CoreFoundation                 0x2542e433 CFRunLoopRunInMode + 106
16 GraphicsServices               0x2c79c0a9 GSEventRunModal + 136
17 UIKit                          0x28a18809 UIApplicationMain + 1440
18 simplyUs                       0x00052013 main (main.m:14)

【问题讨论】:

  • 你找到解决方法了吗?

标签: ios crash ios8


【解决方案1】:

我遇到了同样的问题。

可能我的情况与您的情况相似。一些解除分配的控制器仍然收到方向通知。当我在操作表委托方法中展示控制器时,我崩溃了:

actionSheet:clickedButtonAtIndex:

但是当控制器出现在里面时

actionSheet:didDismissWithButtonIndex:

现在一切正常。我认为我们应该在窗口中显示控制器,当此窗口位于顶部时。因此,在 iOS8 中呈现控制器之前,应关闭所有警报视图/操作表窗口。否则它仍然会收到方向通知。

【讨论】:

    【解决方案2】:

    如果您除了崩溃回溯跟踪之外还有更多与崩溃相关的信息,那将会有所帮助。我怀疑问题出在消息释放对象上;一个典型的例子是从 NSNotification 崩溃。您可以尝试启用僵尸(Edit Schema 中的诊断选项卡),它可以确定是否是这种情况。

    要仔细检查方向支持,我建议在https://developer.apple.com/Library/ios/featuredarticles/ViewControllerPGforiPhoneOS/RespondingtoDeviceOrientationChanges/RespondingtoDeviceOrientationChanges.html 中解释的方法中设置断点 如果你已经实现了它们。

    最后一个警告是,在 iOS 8 中,他们修复了一些关键方法,这些方法在以前的 iOS 版本中错误地忽略了当前方向,例如状态栏高度/宽度 [UIApplication sharedApplication].statusBarFrame.size.height

    这意味着很多代码,包括来自第三方库的代码,都有解决原始问题的代码,现在需要在 iOS 8 中禁用该代码。例如,代码会从逻辑中挂钩,例如查看状态栏高度是否是巨大的,并得出结论系统处于横向。

    【讨论】:

      猜你喜欢
      • 2011-03-25
      • 2015-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-24
      • 1970-01-01
      相关资源
      最近更新 更多