Xcode:调试意外的 iOS 应用程序崩溃
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9150083/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode: debug unexpected iOS app crashes
提问by daveoncode
I'm facing unexpected crashes of my app running on an iPhone 4 with iOS 5.0.1, the app crash without generating any error message nor crash log. I did also enabled zombies and tested with Instruments with no luck... how can I figure out where is the problem? I'm totally stuck :(
我的应用程序在运行 iOS 5.0.1 的 iPhone 4 上运行时遇到意外崩溃,应用程序崩溃而没有生成任何错误消息或崩溃日志。我也启用了僵尸,并在没有运气的情况下使用仪器进行了测试......我怎么能找出问题所在?我完全被困住了:(
ps. I'm using ARC and my app is multi thread (NSOpertations + GCD)
附:我正在使用 ARC,我的应用程序是多线程的(NSOperations + GCD)
采纳答案by Hot Licks
(By popular demand:) There are some hints for catching the failure in this thread.
(应大众要求:)有一些提示可以在此线程中捕获失败。
回答by Audun Kjelstrup
From the breakpoint-menu in Xcode, press the little '+' button at your window bottom left, and add an exception breakpoint. It will give you a heads up if the app throws an exception due to erroneous code.
从 Xcode 的断点菜单中,按下窗口左下角的小“+”按钮,然后添加一个异常断点。如果应用程序由于错误代码而引发异常,它会提醒您。
回答by suraj Gupta
回答by suraj Gupta
add some breakpoint before crashing point and add a lot of NSAssert to check your assertion.
在崩溃点之前添加一些断点并添加大量 NSAssert 来检查您的断言。