簡體   English   中英

ios8 _updateInterfaceOrientationFromDeviceOrientation崩潰

[英]ios8 crash on _updateInterfaceOrientationFromDeviceOrientation

在我的日志記錄服務中遇到了很多此類崩潰。 有什么提示嗎? 我的應用僅支持縱向模式。

線程:崩潰: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)

我遇到過同樣的問題。

我的情況可能與您相似。 一些已解除分配的控制器仍收到定向通知。 當我在操作表委托方法中介紹控制器時,我崩潰了:

actionSheet:clickedButtonAtIndex:

但是當控制器出現在里面時

actionSheet:didDismissWithButtonIndex:

現在一切正常。 我認為,當該窗口位於頂部時,我們應該在窗口中顯示控制器。 因此,在iOS8中展示控制器之前,應關閉所有警報視圖/操作表窗口。 否則,它仍然會收到方向通知。

如果您除了崩潰后退跟蹤之外還有更多與崩潰有關的信息,這將有所幫助。 我懷疑問題出在消息傳遞的已分配對象上。 一個典型的例子是從NSNotification崩潰。 您可以嘗試啟用僵屍(“編輯模式”中的“診斷”選項卡),這可以確定是否是這種情況。

要仔細檢查方向支持,建議您使用https://developer.apple.com/Library/ios/featuredarticles/ViewControllerPGforiPhoneOS/RespondingtoDeviceOrientationChanges/RespondingtoDeviceOrientationChanges.html中說明的方法設置斷點(如果已實現)。

最后一個警告是,在iOS 8中,他們修復了一些以前的iOS版本中錯誤地忽略了當前方向的關鍵方法,例如狀態欄的高度/寬度[ UIApplication sharedApplication].statusBarFrame.size.height

這意味着很多代碼(包括來自第三方庫的代碼)都具有解決原始問題的代碼,並且現在需要在iOS 8中禁用該代碼。例如,代碼會像查看狀態欄高度是否過大和結論系統是橫向的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM