我故意创建了一个“EXC_BAD_ACCESS”错误.. 当然应用程序崩溃,但调试器不知何故缺少“EXC_BAD_ACCESS”消息。 为什么?Xcode 4在调试区域中不显示“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)
你正在使用的是什么开发者或发行版? – 2011-08-17 13:00:16
开发人员 - 调试 – Rizon 2011-08-17 13:28:00
只是释放一个对象不会改变对象,它的内存将存在一段非特定的时间。因此,崩溃可能不会立即引用内存。 – zaph 2011-08-17 14:58:46