So I am getting this error (picture below). What is happening when I get this error is going through my core data data base and averaging out results based on battery statistics that I have collected. This was working fine until I took a break and then came back, plugged it in and it started getting this error. I have an exception breakpoint, but it is still not showing me anything other than the crash in the image.
Anyone know what i should do?
xcode Version 5.0
Let me know if i can post anything else that can help figure out what is causing this!
For any EXC_BAD_ACCESS
errors, you are usually trying to send a message to a released object. The BEST way to track these down is use NSZombieEnabled.
This works by never actually releasing an object, but by wrapping it up as a "zombie" and setting a flag inside it that says it normally would have been released. This way, if you try to access it again, it still know what it was before you made the error, and with this little bit of information, you can usually backtrack to see what the issue was.
It especially helps in background threads when the Debugger sometimes craps out on any useful information.
VERY IMPORTANT TO NOTE however, is that you need to 100% make sure this is only in your debug code and not any code you are testing outside of XCode. Because nothing is ever released, your app will leak and leak and leak. To remind me to do this, I put this log in my appdelegate:
if (getenv("NSZombieEnabled"))
NSLog(@"NSZombieEnabled!");
If you need help finding the exact line, Build-and-Run. When the app crashes, the debugger will show you exactly which line and in combination with NSZombieEnabled, you should be able to find out exactly why and what type of object is being accessed after being released.