Flex 调试查看对象详细信息
有谁知道我如何在调试时以数组或某种形式查看对象详细信息而不是[对象对象]?
谢谢
Does anyone know how I can see my object details as in an array or some sort while debugging instead of [Object object]?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 Flex Builder 或 Flash Builder,则可以将该对象添加到
Expressions
选项卡。调试时,您可以深入了解已添加到“表达式”选项卡的任何对象或类的属性。要将对象添加到
Expressions
选项卡:If you are using Flex Builder or Flash Builder, you could add the object to the
Expressions
tab. When you're debugging you can drill down into the properties of any object or class you've added to the 'Expressions' tab.To add your object to the
Expressions
tab:简短的回答,不。所有类、视图等都是对象,这就是 toString() 函数的工作原理。如果您想查看对象的内部结构,您需要重写 toString() 函数并添加您自己的代码来显示内部结构。
另一种方法是使用describeType函数查看类内部,获取属性,然后使用实用程序类显示这些属性及其值。然而,与使用 toString 方法相比,这非常慢。
就我个人而言,如果我真的想知道对象的值,我只需使用调试器。
Short answer, no. All classes, views, etc are objects and this is how the toString() function works. If you want to see the internals of the object, you need to override the toString() function and add your own bit of code to show the internals.
Another way of doing it would be to use describeType function to look inside the class, get the properties and then show those properties and their values using a utility class. However, this is extremely slow compared to using the toString approach.
Personally, if I really want to know the values of my objects, I just use the debugger.