Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
458 views
in Technique[技术] by (71.8m points)

iphone - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...