应用程序唤醒时EXC_BAD_ACCESS(SIGBUS)和EXC_BAD_ACCESS(SIGSEGV)崩溃

时间:2011-05-19 21:56:12

标签: iphone objective-c cocoa-touch exc-bad-access

我遇到了一些应用程序崩溃的问题,我需要一些方向,所以我可以解决它。我有一个带有主视图和模态视图的应用程序,很像默认的双面实用程序模板。当我第一次运行应用程序时,一切运行正常,包括模态视图。但是,当我返回主屏幕然后返回应用程序时,如果我在上一个会话中激活了模态视图,应用程序将崩溃。 (不知道术语和作为菜鸟,我称之为应用程序醒来。)如果我没有激活模态视图并且只是停留在上一个会话中的主视图上,那么应用程序将恢复运行问题。

现在,我遇到了进一步追踪这个问题的问题,并会欣赏一些方向。当我在运行xcode时停止应用程序时,调试器停止。仪器告诉我,我已经修复了所有内存泄漏。这些是最新的崩溃日志:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x35248c98 0x35246000 + 11416
1   CoreLocation                    0x35205f78 0x351fe000 + 32632
2   CoreLocation                    0x35206f42 0x351fe000 + 36674
3   CoreLocation                    0x35204a64 0x351fe000 + 27236
4   CoreLocation                    0x3520078a 0x351fe000 + 10122
5   CoreLocation                    0x352018cc 0x351fe000 + 14540
6   CoreLocation                    0x35202d50 0x351fe000 + 19792
7   CoreFoundation                  0x316fd706 0x31691000 + 444166
8   CoreFoundation                  0x31706a90 0x31691000 + 481936
9   CoreFoundation                  0x31708838 0x31691000 + 489528
10  CoreFoundation                  0x31709606 0x31691000 + 493062
11  CoreFoundation                  0x31699ebc 0x31691000 + 36540
12  CoreFoundation                  0x31699dc4 0x31691000 + 36292
13  GraphicsServices                0x31018418 0x31014000 + 17432
14  GraphicsServices                0x310184c4 0x31014000 + 17604
15  UIKit                           0x317bfd62 0x31791000 + 191842
16  UIKit                           0x317bd800 0x31791000 + 182272
17  MyApp                           0x000021a4 0x1000 + 4516
18  MyApp                           0x00002158 0x1000 + 4440

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x709ffd70
Crashed Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x35248ca4 0x35246000 + 11428
1   CoreLocation                    0x35206f42 0x351fe000 + 36674
2   CoreLocation                    0x35204a64 0x351fe000 + 27236
3   CoreLocation                    0x3520078a 0x351fe000 + 10122
4   CoreLocation                    0x352018cc 0x351fe000 + 14540
5   CoreLocation                    0x35202d50 0x351fe000 + 19792
6   CoreFoundation                  0x316fd706 0x31691000 + 444166
7   CoreFoundation                  0x31706a90 0x31691000 + 481936
8   CoreFoundation                  0x31708838 0x31691000 + 489528
9   CoreFoundation                  0x31709606 0x31691000 + 493062
10  CoreFoundation                  0x31699ebc 0x31691000 + 36540
11  CoreFoundation                  0x31699dc4 0x31691000 + 36292
12  GraphicsServices                0x31018418 0x31014000 + 17432
13  GraphicsServices                0x310184c4 0x31014000 + 17604
14  UIKit                           0x317bfd62 0x31791000 + 191842
15  UIKit                           0x317bd800 0x31791000 + 182272
16  MyApp                           0x000021a4 0x1000 + 4516
17  MyApp                           0x00002158 0x1000 + 4440

所以,从我读过的内容来看,似乎我正在引用一个已被删除或被覆盖的对象?有了这个,我只是抓住稻草,我不知道我怎么会跟踪它。

思想?

1 个答案:

答案 0 :(得分:3)

从respondsToSelector调用它可能是你的ModalView,AddPersonViewController我猜,这是保留而不是在dealloc和viewDidUnload中分配委托属性或不设置为nil委托。在这种情况下,它将尝试向您委派的非现有邮件发送消息仍然保留引用。

@property (nonatomic, assign) id <delegate> *delegate;


self.delegate = nil; in dealloc and viewDidUnload.
相关问题