我的应用程序在每次尝试接通一个调用时崩溃。没有调试器,它工作正常。EXC_BAD_ACCESS(代码= 1,地址= 0x0)在调试器中加入时
此外,当我在模拟器中运行应用程序时,它可以很好地调试或不调试。
最近我将我的Mac OS X 10.8升级到了10.9(小牛)。升级前没有问题。
是什么原因导致该问题,我该如何解决?
下面是后面的跟踪。我的应用使用ARC。我已经启用了僵尸并添加了异常断点,但没有检测到僵尸,也没有触发异常断点。
* thread #1: tid = 0x2503, 0x00000000, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00000000
frame #1: 0x35e170c4 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 72
frame #2: 0x35e17076 UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
frame #3: 0x35e17054 UIKit`-[UIControl sendAction:to:forEvent:] + 44
frame #4: 0x35e1690a UIKit`-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 502
frame #5: 0x35e16e00 UIKit`-[UIControl touchesEnded:withEvent:] + 488
frame #6: 0x35d3f5f0 UIKit`-[UIWindow _sendTouchesForEvent:] + 524
frame #7: 0x35d2c800 UIKit`-[UIApplication sendEvent:] + 380
frame #8: 0x35d2c11a UIKit`_UIApplicationHandleEvent + 6154
frame #9: 0x37a1e5a2 GraphicsServices`_PurpleEventCallback + 590
frame #10: 0x37a1e1d2 GraphicsServices`PurpleEventCallback + 34
frame #11: 0x33ef9172 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
frame #12: 0x33ef9116 CoreFoundation`__CFRunLoopDoSource1 + 138
frame #13: 0x33ef7f98 CoreFoundation`__CFRunLoopRun + 1384
frame #14: 0x33e6aebc CoreFoundation`CFRunLoopRunSpecific + 356
frame #15: 0x33e6ad48 CoreFoundation`CFRunLoopRunInMode + 104
frame #16: 0x37a1d2ea GraphicsServices`GSEventRunModal + 74
frame #17: 0x35d80300 UIKit`UIApplicationMain + 1120
frame #18: 0x000faac8 MyApp`main(argc=1, argv=0x2fd0fd08) + 116 at main.m:16
编辑:
我有最新版本的Xcode 5.0.1(5A2053)。
我已经从头开始创建新的应用程序,并运行它没有问题。然后,我在ViewController
的viewDidLoad
中放置了一个断点,并试图跨过。在这里,我得到了另一个崩溃
* thread #1: tid = 0x2503, 0x3bb9d7c4 libobjc.A.dylib`objc_msgSendSuper2 + 4, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x4)
frame #0: 0x3bb9d7c4 libobjc.A.dylib`objc_msgSendSuper2 + 4
frame #1: 0x000b913a test`-[ViewController viewDidLoad](self=0x1cda5c70, _cmd=0x361bd5db) + 62 at ViewController.m:19
frame #2: 0x35d4b594 UIKit`-[UIViewController loadViewIfRequired] + 364
frame #3: 0x35d8bd78 UIKit`-[UIWindow addRootViewControllerViewIfPossible] + 64
frame #4: 0x35d87aec UIKit`-[UIWindow _setHidden:forced:] + 364
frame #5: 0x35dc91e8 UIKit`-[UIWindow makeKeyAndVisible] + 60
frame #6: 0x35d8c83e UIKit`-[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1666
frame #7: 0x35d8484a UIKit`-[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 698
frame #8: 0x35d2cc38 UIKit`-[UIApplication handleEvent:withNewEvent:] + 1004
frame #9: 0x35d2c6cc UIKit`-[UIApplication sendEvent:] + 72
frame #10: 0x35d2c11a UIKit`_UIApplicationHandleEvent + 6154
frame #11: 0x37a1e5a2 GraphicsServices`_PurpleEventCallback + 590
frame #12: 0x37a1e1d2 GraphicsServices`PurpleEventCallback + 34
frame #13: 0x33ef9172 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34
frame #14: 0x33ef9116 CoreFoundation`__CFRunLoopDoSource1 + 138
frame #15: 0x33ef7f98 CoreFoundation`__CFRunLoopRun + 1384
frame #16: 0x33e6aebc CoreFoundation`CFRunLoopRunSpecific + 356
frame #17: 0x33e6ad48 CoreFoundation`CFRunLoopRunInMode + 104
frame #18: 0x35d83484 UIKit`-[UIApplication _run] + 668
frame #19: 0x35d80300 UIKit`UIApplicationMain + 1120
frame #20: 0x000b93bc test`main(argc=1, argv=0x2fd51d30) + 116 at main.m:16
frame #21: 0x3bfd9b20 libdyld.dylib`start + 4
编辑2:
格雷格·克莱顿在XCode 5 Crashes while running the app on device建议以下
Others have seen this issue.
A few things to try:
1 - Reboot your device and try again. The theory is an old developer disk image is already mounted and won't be unmounted until you reboot.
2 - Re-install the OS on the device
Hopefully #1 fixes your issue. Others have done #2 and had their issue fixed, but hopefully it doesn't require an OS re-install.
我做了两个,并没有帮助。
我试图使用其他设备,它有所作为。如果我在iOS 6.1中使用iPod Touch但在iOS 7.0.2中运行正常,则例外仍然存在。
因此,它看起来像问题与设备上安装的iOS版本有关。我仍然不确定如何解决它。
编辑3:
我的命令行工具版本的Xcode我的版本(我只有一个版本的命令行工具,实际上)相匹配。
这些问题可能与正在调试的代码无关。它与由Xcode创建的新创建的Single View Application崩溃。
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
我have asked在苹果开发者论坛,并得到了以下杰森莫伦达响应:
我们一直在跟踪这听起来像你看到的一个bug,它加强了琐碎的代码时崩溃这里。这是一个微妙的时间问题,需要稍微慢一点的主机或者稍微慢点的设备。它主要是iPhone 4和类似的 ,这将在iOS 7中看到。使用iOS 6,iPhone 4和iPhone 3GS 设备最有可能会遇到它。 ...这个问题将只有 与Xcode 5.0.1发生。
所以,它似乎是Xcode中的一个错误。
下载它,你必须更新至最新版本的Xcode以及? – DarkDust
@DarkDust是的,我做到了。 – Bobrovsky
我想你会有更好的机会在苹果开发者论坛上获得答案,有时苹果工程师可以提供帮助。我怀疑正常的开发者会对这个问题提供帮助。 – DarkDust