Finding Messages Sent to Deallocated Objects

Find messages sent to deallocated objects using the Instruments Zombies template. A message sent to a deallocated object can cause your app to crash.

bullet
To find messages sent to deallocated objects
  1. Open the Zombies template.

  2. Choose your app from the Choose Target pop-up menu.

  3. Click the Record button and exercise your app until a Zombie Messaged dialog appears.

  4. Click the focus button to the right of the message text in the dialog.

  5. Open the Extended Detail pane and double-click the zombie event type in the object history table.

  6. Double-click the Responsible Caller in the stack trace to display the responsible code.

The Instruments Zombies template substitutes an object of type NSZombie for objects that are released to a reference count of zero. When a NSZombie is messaged, a Zombie Message dialog appears. Clicking the focus button to the right of the message in the Zombie Detected dialog displays the complete memory history of the overreleased object.

The screenshot shows the Instruments template targeting the SplitViews app, a Zombie Detected dialog, the Detail pane table view displayed by the focus button in the Zombie Detected dialog, and the stack trace with the responsible caller selected.

../Art/ZombiesFigure500x333-2.png