How to track dealloc of an abstract object class (NSMutable...)

Posted by Thomas Tempelmann on Stack Overflow See other posts from Stack Overflow or by Thomas Tempelmann
Published on 2010-06-14T11:31:39Z Indexed on 2010/06/14 11:42 UTC
Read the original article Hit count: 214

I have a bug in my code caused by a premature freeing of a ObjC object. I seem not to be able to find it by just looking at my code.

There's usually a simple trick to track the dealloc to any class: Implement dealloc, and set a breakpoint. This even usually works with standard objects, by subclassing them and making sure I instantiate the subclass instead of the standard class.

However, this does not seem to work with NSMutableArray, and probably neither with similar NSMutable... classes. Some explanations for this can be found here: link text

Any other ideas how to track the dealloc invocation of a particular class or object so that I can see the call stack? It's probably possible with DTrace. Any pointers without having to read the entire dtrace docs first?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about memory-leaks