iphone - Querying to an instance if it is already deallocated -


i know memory management rules , there no need of asking if follow these rules. but, wonder if there way know if instance deallocated without throwing exception. app uses object view on app can become delegate. sometimes, i'm getting known error. can avoid setting delegate nil on dealloc method of current delegate owner. in summary... have way know if object deallocated?

thanks.

can tell if pointer points garbage?

no, not really. once object deallocated, memory can reused at time. it'll point garbage (causing crash), it'll point different obj-c object, , memory not have been reused yet.

the main exception if set environment variable nszombieenabled=yes (in "edit scheme" somewhere in xcode 4), memory used objects never deallocated (unless set nsdeallocatezombies=yes, or so); instead, sending message zombie cause exception. it's useful debugging, largely because tells class name of instance got deallocated.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -