we recently had an issue in Cocoa, where for some reason we had two view controllers active at the same time (with two OpenGLES views active), leading to a bunch of issues. I then realized that there seem to be no good Cocoa debugging tools. From my Win32 days, I remember that little tool Spy++, which could inspect the window hierarchy. That was a great to help ensure everything is sane. I think with a tool like this many bugs in our Cocoa apps could’ve been avoided or more easily spotted.
Now, it doesn’t seem that there is something comparable for Cocoa. As a matter of fact, it doesn’t seem like there is _anything_ at all even in the debugging tools in XCode to even inspect the view hierarchy, and see what resources are allocated and used right now.
So I looked into some of the APIs and I noticed that it’s actually quite easy to fetch most of this stuff. UIApplication gives access to all windows, which in turn gives access to all views and subviews. Hence, I started thinking about implementing a little Mac tool that connects to a little server running in your debug iOS application, which could fetch the hierarchy and send it to the desktop for inspection.
But before I start writing a tool like this (which I’d open source), I wanted to ask the iDevBlogADay community if anyone has seen a something similar to this out in the wilds of the internet.