【发布时间】:2011-05-19 21:56:12
【问题描述】:
我遇到了一些应用程序崩溃的问题,我需要一些指导以便修复它。我有一个带有主视图和模式视图的应用程序,很像默认的反面实用程序模板。当我第一次运行该应用程序时,一切都运行良好,包括模态视图。但是,当我返回主屏幕然后返回应用程序时,如果我在上一个会话中激活了模态视图,应用程序将崩溃。 (不知道这个词并且是一个菜鸟,我称之为应用程序唤醒。)如果我没有激活模态视图并且只是在上一个会话中停留在主视图上,那么应用程序会继续运行而没有任何问题。
现在,我在进一步追踪这个问题时遇到了问题,希望能得到一些指导。当我在通过 xcode 运行时停止应用程序时,调试器会停止。 Instruments 告诉我我已经修复了所有的内存泄漏。以下是最新的崩溃日志:
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
那么,从我所读到的内容来看,我似乎在引用一个已以某种方式被擦除或覆盖的对象?有了这个,我只是抓住了稻草,我不知道我什至会如何追踪它。
想法?
【问题讨论】:
-
查看控制台,看看它在哪一行崩溃。
-
我正在尝试,但是当我重新启动它时它没有显示输出。通话中。我意识到如果你在 xcode 中只使用“运行”,它不会像“构建和运行”那样重新启动它。每次我通过 xcode 重新启动它时,我一直在使用键盘快捷键进行构建和运行。呃。无论如何,我得到了这个: *** -[AddPersonViewController respondsToSelector:]: message sent to deallocated instance 0x1f8100 off to do some digging。谢谢!
-
这可能是iphone开发中最常见的一个问题。查看this link 了解缩小范围的好方法。
标签: iphone objective-c cocoa-touch exc-bad-access