[Xcode]What to do when a message sent to deallocated instance appears

Hello, this is Bono.
A reminder of how to spit out error content.

message sent to deallocated instance XX

When the following error occurs.

NewImage

How to make it spit out an error

Go to Product→Scheme→Edit Scheme and add environment variables as follows

  • NSZombieEnabled: YES
  • MallocStackLogging: YES
  • NSDebugEnabled: YES

Screenshot 2014 02 08 08 51 23

This will spit out more detailed information when the error occurs again.