Re: Problem tracking crash in iOS
Re: Problem tracking crash in iOS
- Subject: Re: Problem tracking crash in iOS
- From: Laurent Daudelin <email@hidden>
- Date: Wed, 16 Nov 2011 16:06:17 -0800
Thanks all for the correction about dealloc. I'll try to see if I can put it to good use in my case.
As for this problem, I'm thinking that something else is trashing the memory, will check with the person who last modified that part and see where we go from there.
Thanks for all the insightful comments!
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/
Logiciels Nemesys Software email@hidden
On Nov 16, 2011, at 15:59, Doug Hill wrote:
> On Nov 16, 2011, at 3:45 PM, Laurent Daudelin wrote:
>
>> Yeah, except the project uses ARC which prevents using dealloc…
>
> With ARC enabled, you can still define a dealloc method for your object and it will get called when the ref-count of the object goes to 0. Apple's ARC documentation discourages writing dealloc methods but doesn't forbid it. ARC only stops you from calling release directly. So, if the object doesn't have a dealloc, you can define one for the purposes of the breakpoint.
>
>> This is an interesting problem, though. If I turn on NSZombieEnabled and if the original observer is deallocated, shouldn't an NSZombie takes its place and shouldn't the NSZombie raises an exception when it receives the message that was registered with the notification? Why isn't it happening?
>
> You are correct, if the issue is that messages are sent to a destructed object with NSZombie enabled, it should throw an exception AND print some text to the console letting you know info about the exception. You might not see the the exception if there was code to suppress it e.g. a @try/@catch block. Debugging these things is tricky so it's best to try many things and not to assume too much. For example, your memory footprint will change with NSZombie enabled. So how objects are laid out in memory can change leading to different behavior with respect to object allocation and reuse of destructed objects.
>
> Memory corruption bugs are usually very difficult to debug and don't generally have one solution for al cases. Verify your code, collect as much data about the problem, hone in on a solution.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden