Activate NSZombie to find the object causing EXC_BAD_ACCESS

If you get an EXC_BAD_ACCESS with the following stack trace, activating NSZombie could help you to find the object causing the problem.


0x01285a63 in objc_msgSend
0x0580e400 in ??
0x0105fb8d in _ CFAutoreleasePoolPop
0x00022443 in -[NSAutoreleasePool release]
0x002d3bf2 in _ UIApplicationHandleEvent
0x018cca36 in PurpleEventCallback
0x01105064 in __ CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__
0x010656f7 in __CFRunLoopDoSource1
0x01062983 in __CFRunLoopRun
0x01062240 in CFRunLoopRunSpecific
0x01062161 in CFRunLoopRunInMode
0x002cafa8 in -[UIApplication _run]
0x002d742e in UIApplicationMain
0x00001ca0 in main at main.m:14

You can activate NSZombie by doing the following:

  1. Get info of the executable.
  2. Go to the arguments tab.
  3. In the “Variables to be set in the environment:” section add:
  4. Name: NSZombieEnabled Value: YES

Then you can run  your app and when it crashes you should see an log entry in the console about the object causing the problem.

posted in Development by david

Follow comments via the RSS Feed | Einen Kommentar hinterlassen | Trackback URL

Leave Your Comment