I’m in the midst of debugging a hard to find issue with a view in XCode, and would love it if there was a way to inspect the current view hierarchy. In the past, my approach has been to remove all views in my app, and add each view back in, in order, until I could get the problem to re-appear. The aforementioned approach is time consuming, tedious, and begs for a more robust, repeatable solution.
So, I ask the group, is there a way to inspect the view hierarchy in XCode during a debug session? Is there a 3rd party utility that does this?
In the debugger, you can type
or if you want to use an NSLog statement
Apple mentions it in this document: http://developer.apple.com/library/ios/#technotes/tn2239/_index.html
Otherwise, though, I have problems finding documentation for it so I don’t know if it constitutes a “private API” or not. In other words, you might not want to include it in code you submit to the App Store.