When deploying the application to the device, the program will quit after a few cycles with the following error:
Program received signal: \"EXC_BAD_ACCESS\".
I forgot to return self in an init-Method... ;)
The 2010 WWDC videos are available to any participants in the apple developer program. There's a great video: "Session 311 - Advanced Memory Analysis with Instruments" that shows some examples of using zombies in instruments and debugging other memory problems.
For a link to the login page click HERE.
Another method for catching EXC_BAD_ACCESS exceptions before they happen is the static analyzer, in XCode 4+.
Run the static analyzer with Product > Analyze (shift+cmd+B). Clicking on any messages generated by the analyzer will overlay a diagram on your source showing the sequence of retains/releases of the offending object.
Forgot to take out a non-alloc'd pointer from dealloc
. I was getting the exc_bad_access on my rootView of a UINavigationController, but only sometimes. I assumed the problem was in the rootView because it was crashing halfway through its viewDidAppear{}. It turned out to only happen after I popped the view with the bad dealloc{} release, and that was it!
"EXC_BAD_ACCESS" [Switching to process 330] No memory available to program now: unsafe to call malloc
I thought it was a problem where I was trying to alloc... not where I was trying to release a non-alloc, D'oh!
How i deal with EXC_BAD_ACCESS
Sometimes i feel that when a EXC_BAD_ACCESS error is thrown xcode will show the error in the main.m class giving no extra information of where the crash happens(Sometimes).
In those times we can set a Exceptional Breakpoint in Xcode so that when exception is caught a breakpoint will be placed and will directly intimate the user that crash has happened in that line
I got it because I wasn't using[self performSegueWithIdentifier:sender:]
and -(void) prepareForSegue:(UIstoryboardSegue *)
right