用于 iPhone/iPad 开发的最接近 Snoop 的实用程序是什么?
对于 iPhone/iOS 开发,是否有任何与 WPF Snoop 实用程序 相近的东西?
我找到了 Mike Ash 的 ObjC 包装器,但这似乎对反射比分析 UIKit 的实例状态更有帮助层次结构。
这是有用的一个例子:我在选项卡栏视图中集成了一个分割视图,但它不太有效。是的,有一些代码可以让它“工作”。不过,我想亲自动手解决自己的问题,以便更好地掌握这个平台。
最明显的实现似乎是将根视图控制器实例传递给实用程序类方法。
然后,该实用程序可以在调试窗口中输出 UIKit 层次结构,或者弹出一个模式视图,让您像 Snoop 一样以图形方式浏览状态。
Is there anything remotely close to the WPF Snoop utility for iPhone/iOS development?
I have found Mike Ash's ObjC wrapper, however this seems more helpful for reflection than for analyzing the instance state of UIKit hierarchies.
An example of where this is useful: I integrated a split-view inside of a tabbar view and it's not quite working. Yes there are some bits of code out there for this to just "make it work". However I want to get dirty and fix my own problems to better master the platform.
The most obvious implementations seem to be to pass in a root viewcontroller instance to a utility class method.
The utility could then output the UIKit hierarchy in the debug window, or to get fancy, popup a modal view that lets you graphically browse the state like Snoop.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想亲自动手,只需利用 Objective-C 的动态行为,然后自己实现即可。您可以使用递归方法在 UIView 上创建一个类别,打印出有关其子级的信息。然后在 GDB 中只需在窗口上调用它(因为窗口是 UIView 的子类。类似于:
在 GDB 中:
If you want to get your hands dirty, just leverage objective-C's dynamic behavior, and implement it yourself. You could create a category on UIView with a recursive method that prints out info about its children. Then in GDB just call it on the window (since window is a subclass of UIView. Something like:
And in GDB: