Objective-C “message sent to deallocated instance 0x5633b0”

后端 未结 7 1900
我寻月下人不归
我寻月下人不归 2020-12-12 14:07

I appear to have some overzealous releasing going on in my obj-C app - getting error message

\"-[myobj release]: message sent to deallocated instance

7条回答
  •  無奈伤痛
    2020-12-12 14:32

    What worked best for me when I ran into similar problems recently was the following:

    1. Under under Project->Edit Active Executable -> Arguments tab -> Environment variables section I added and set to YES the following variables: NSAutoreleaseFreedObjectCheckEnabled, NSZombieEnabled and NSDebugEnabled.

    2. Under the Run menu, I selected Enable Guard Malloc.

    With these settings the debugger provided more hints on what's wrong with my code.

    (I found these tips here)

    Good luck, Ori

提交回复
热议问题