How to track dealloc of an abstract object class (NSMutable...)
- by Thomas Tempelmann
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?