My app encountered a EXC_BAD_ACCESS error and app crash (no other information at console at all). I found some tutorials about how to deal with this kind of problem. So I add NSZombieEnabled environment variable and set it to YES. But the strange thing happened. The app don't crash anymore and there is nothing useful in console. After I remove this variable, the app crash again.
I know it must be something wrong in memory management. But how can I debug the problem?
Last edited by frankmail007; 10-24-2010 at 02:55 AM.
My app encountered a EXC_BAD_ACCESS error and app crash (no other information at console at all). I found some tutorials about how to deal with this kind of problem. So I add NSZombieEnabled environment variable and set it to YES. But the strange thing happened. The app don't crash anymore and there is nothing useful in console. After I remove this variable, the app crash again.
I know it must be something wrong in memory management. But how can I debug the problem?
My app encountered a EXC_BAD_ACCESS error and app crash (no other information at console at all). I found some tutorials about how to deal with this kind of problem. So I add NSZombieEnabled environment variable and set it to YES. But the strange thing happened. The app don't crash anymore and there is nothing useful in console. After I remove this variable, the app crash again.
I know it must be something wrong in memory management. But how can I debug the problem?
Make sure you are using a debug build of your app, and run it in XCode using the "Build and debug" menu option (command Y)
EXEC_BAD_ACCESS is almost always an over-released object, so zombies is the right tool to find it.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Also check the stack to learn where the error was made. That can help.
Unfortunately, with over-released objects the stack track is not usually useful. By the time the crash occurs, the source of the over-release is usually long gone.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.