开发者

XCode 4 Not Breaking On Correct Line on EXC_BAD_ACCESS

开发者 https://www.devze.com 2023-02-23 00:28 出处:网络
I recently had my xcode upgraded to version 4, and I have an EXC_BAD_ACCESS exception in my code, but despite setting NSZombieEnabled in the environment it\'s still showing the break point on the thre

I recently had my xcode upgraded to version 4, and I have an EXC_BAD_ACCESS exception in my code, but despite setting NSZombieEnabled in the environment it's still showing the break point on the thread1, int retVal = UIApplicationMain(argc, argv, nil, nil); line.

I'm sure I had this configured in XCode 3 to stop on the line of my code that was causing the exception. Now it doesn't do t开发者_运维百科hat and displays no error messages in the GDB window either.

Does anyone know what I might be missing?

Thanks Ray


EXC_BAD_ACCESS is not an exception, at least not as far as breakpoints are concerned - it means the code is trying to call a method on an object that does not exist anymore, because you released it.

The easiest way to find this in XCode4 is to run Instruments (Cmd-I), and in the dialog that pops up asking you which instrument to use, choose "Zombies". Then do whatever to cause the crash, and you will see a dialog pop up with "Zombie Messaged". Click on the little arrow and you will get a history of what created, retained, or released the object. Then you can figure out who released the object early.

0

精彩评论

暂无评论...
验证码 换一张
取 消