iPhone — is it possible to inspect the frame of a UIView in the Xcode debugger?

前端 未结 12 558
执念已碎
执念已碎 2021-02-02 08:18

When the debugger is stopped at a breakpoint, I can\'t find the frame of any of my UIViews in there.

Is it possible to do this?

EDIT: starting a bounty due to th

12条回答
  •  伪装坚强ぢ
    2021-02-02 08:40

    If you go to the debugger panel, you can type this in while you are at a breakpoint:

    (gdb) print (CGRect) [self frame]
    $1 = {
      origin = {
        x = 0, 
        y = 0
      }, 
      size = {
        width = 100, 
        height = 100
      }
    }
    

    When using the console debugger you can press the up arrow key to cycle through previous commands. Pressing return without entering a command repeats the last command.

提交回复
热议问题