我故意创建“ EXC_BAD_ACCESS”错误。
该应用程序当然崩溃了,但调试器某种程度上缺少“ EXC_BAD_ACCESS”消息。
这是为什么?
这是我正在使用的代码:
NSString *str = [[NSString alloc] initWithFormat:@"Foo"];
NSArray *a = [[NSArray alloc ]initWithObjects:str, nil];
[str release];
[a release];
NSLog(@"%@",str);
这是调试器日志:
GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".Attaching to process 41313.
sharedlibrary apply-load-rules all
(gdb)
最佳答案
为了反省告诉我的向同事询问类似问题的内容,有人告诉我这是Apple的“对象实例未设置为对象实例”。调试器有时会显示造成它的原因的转储,有时则完全忽略它。我敢肯定这是有原因的,但它很可能在Apple大厅深处的文档中隐藏了。到目前为止,我还没有找到EXC_BAD_ACCESS转储的任何模式(或缺少这些模式)。我刚刚学会忽略丢失的信息,并开始寻找指针问题!
虽然并不太有用,但我还是想分享一下!
关于iphone - Xcode 4在调试区域中未显示“EXC_BAD_ACCESS”。为什么不?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7092801/