2

我有一个提交给 iTunes 的崩溃日志。我不知道如何重现这个问题,所以我很难解决问题。

[UIDevice setOrientation:animated:] 在 iOS 6 上导致 EXC_BAD_ACCESS 崩溃。

任何建议将不胜感激!

这是崩溃日志的相关部分:

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x347d9692 objc_msgSend_stret + 18
1   CoreFoundation                  0x3641f034 _CFXNotificationPost
2   Foundation                      0x33ee1d8c -[NSNotificationCenter postNotificationName:object:userInfo:]
3   UIKit                           0x377a5c68 -[UIDevice setOrientation:animated:]
4   UIKit                           0x377a03de -[UIApplication handleEvent:withNewEvent:]
5   UIKit                           0x3779f6d0 -[UIApplication sendEvent:]
6   UIKit                           0x3779f11e _UIApplicationHandleEvent
7   GraphicsServices                0x369525a0 _PurpleEventCallback
8   GraphicsServices                0x369521ce PurpleEventCallback
9   CoreFoundation                  0x364a3170     __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
10  CoreFoundation                  0x364a3112 __CFRunLoopDoSource1
11  CoreFoundation                  0x364a1f94 __CFRunLoopRun
12  CoreFoundation                  0x36414eb8 CFRunLoopRunSpecific
13  CoreFoundation                  0x36414d44 CFRunLoopRunInMode
14  GraphicsServices                0x369512e6 GSEventRunModal
15  UIKit                           0x377f32fc UIApplicationMain
16  MyApp                       0x0001234a main + 70
17  MyApp                       0x000122fc start + 36
4

2 回答 2

1

我不认为这是一个搞砸的活体。我想说您忘记取消注册观察者并且它已被释放但仍计划接收通知 - 查看订阅此特定通知的任何类并查看添加/删除是否平衡

于 2012-11-08T09:25:46.833 回答
1

就像@Daij-Djan 已经提到的那样,它本身不可能是方向改变,因为还有一个帖子NSNotification并且应用程序正在崩溃。再次查看您添加的课程NSNotificationCenter,也许取消注册没有问题,但像我在这里找到的帖子一样注册。

于 2015-05-19T09:02:30.940 回答