Answer: EXC_BAD_ACCESS exceptions usually happen when your code wants to use objects that have already been released. When the error is caught, the call stack is usually has gone on vacation. This is the probable reason of the silent exit and the jump to the main.m as the last resort of your debugger.
There is a well known NSZombieEnabled environment variable that, when it’s enabled, leaves a dummy object behind for every deallocated object. It lets us trace released objects while chasing an EXC_BAD_ACCESS exception. When NSZombieEnabled is set to YES, the class of all deallocated objects is dynamically changed to _NSZombie. The memory region will never free, so NSZombieEnabled should not be left in place otherwise you will spend hours trying to find memory leaks. Do not forget to set its value to NO when you are ready.
Where and how to set NSZombieEnabled to YES in Xcode 4?1. Go to your project in Xcode 4 2. Environment variables can be set up in the Scheme editor (find Product -> Edit scheme… in menu bar): 3. Name the variable as NSZombieEnabled and set its value to YES. 4. Run your app in Debug mode. You likely get a … message sent to deallocated instance… message and the debugger stops at the line in error. This information leads to the problem. 5. When ready, disable NSZombieEnabled by changing YES to NO. PS: I checked your code. You should apply retain property in your subclasses:
@property (nonatomic, retain) UIImage *imageBackground;