I need to convert a NSDate to a string using my personal data format…
The problem is that this code on the simulator (4.01) crashes…
sometimes the code is “freezed”, sometimes give the BAD_ACCESS…
here is the code:
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
It’s likely not this code, but some other problem in your app. I wrote a blog that goes through the various ways to find the bug
http://www.loufranco.com/blog/files/debug-iphone-crash-EXC_BAD_ACCESS.html
The issue is you get EXC_BAD_ACCESS at the point that a bad memory access is made, not at the point that corrupted the heap or caused the underlying problem.
If alloc is crashing, it’s a good bet that your heap is corrupt, and that the corruption happened earlier than this code.