xcode4调试报错exc_bad_access

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.

To edit environment variables, go to Menu Product / Edit Scheme…, select the desired configuration (you probably want 'Run') from the left sidebar first and then click on the Arguments tab. Environment variables are configurable there.

错误原因为提前release。找不到引用。可以设置调式工具来查看哪里报错:选择 menu-》product-》edit scheme 

在左边导航选择run。。选项,右边点击arguments 标签。在environment variables中配置

你可能感兴趣的:(xcode4调试报错exc_bad_access)