William Jockusch
William Jockusch

Reputation: 27335

breakpoint to cause iOS app to stop immediately when messaging a zombie object?

I have a memory management bug in my iOS app. I have set NSZombieEnabled, and the "message sent to deallocated object" message duly appears in the console. But execution appears to go past the point of that message before the app crashes. At a minimum, it is stepping out of some methods. This makes it harder to track down the bug.

Is there a way I can get execution to stop right when the message is sent to the deallocated object?

Upvotes: 4

Views: 440

Answers (2)

Daniel Dickison
Daniel Dickison

Reputation: 21882

This blog post says setting a breakpoint on -[_NSZombie methodSignatureForMethod:] will do the trick: http://www.fromconcentratesoftware.com/2007/08/09/nszombieenabled-for-the-debugger-adverse/

Upvotes: 3

Pier-Olivier Thibault
Pier-Olivier Thibault

Reputation: 3927

Have you tried to put a breakpoint in -(void)dealloc?

Upvotes: 0

Related Questions