我故意創建了一個「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