Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-C "message sent to deallocated instance 0x5633b0"

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

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

. I know the class of the object instance causing the problem, but this class is used all over to create many instances.

My thought is I could put some logging in the init method of the class to log whatever "0x5633b0" corresponds to which should help me track down where the instance is being created.

What exactly is the "0x5633b0" and is there any way I can get access to that value in the code to log it?

Thanks.


1 Answers

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

like image 68
Ori Avatar answered Sep 12 '25 18:09

Ori