简体   繁体   中英

In Xcode, how can I get the instance properties of self in the debug area?

I'm using Xcode 6 (and Swift, but I don't think it really matters in this case) and trying to use breakpoints to debug my iOS application. Specifically, I want to inspect certain properties of the current instance of the UIKit object.

So for example, let's say I place a breakpoint inside a view controller. In the debug area, I see self . Expanding that gives me the UIKit class I'm working with. Looks like this:

调试区域的屏幕截图

What I need is to be able to inspect certain properties on that object. Let's say, for instance, I want to see the headerReferenceSize property. I can't find it anywhere. My current theory is that I'm seeing the class , not the instance of the class? Is that a possibility? If so, is there any way to inspect the instance of, in this case, FeedFlowLayout ?

I'm able to get by with just using println the check the value, or move breakpoints around, but it would be really helpful to inspect all of the properties at once.

You should be able to see the properties of self in the debug area you've shown. Just scroll down. If that doesn't work for some reason, you can type debug commands into the debug console.

If you want to look at headerReferenceSize , type:

expr headerReferenceSize

Into the debugger console and press enter. It should display the value of that variable on the next line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM