Does anyone kn开发者_如何学Cow how I can see my object details as in an array or some sort while debugging instead of [Object object]?
Thanks
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:
- Highlighting your object you want to add and right-click.
- Select "Create Watch Expression".
- Add a breakpoint in your app wherever you need to view your object's details.
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.
精彩评论