并非所有值对象都可以使用XCode Watch和Debug控制台查看

Ser*_*gey 5 xcode objective-c

例如,由于某种原因initWithNibName:bundle:我无法看到其值self.view.bounds.size.width,必须停止程序并使用NSLog.当我输入self.view.bounds.size.width手表时,我会在右侧显示"输入表达式"消息.当我输入print self.view.bounds.size.width调试控制台时,出现以下错误:

error: unsupported expression with unknown type
error: 1 errors parsing expression
Run Code Online (Sandbox Code Playgroud)

有没有办法看到我使用NSLog可以看到的所有值?

编辑:由@ Abizern的建议尝试p self.view.bounds.size.widthpo self.view.bounds.size.width- 相同的结果.

Abi*_*ern 4

尝试

p self.view.bounds.size.width
Run Code Online (Sandbox Code Playgroud)

或者:

po self.view 
Run Code Online (Sandbox Code Playgroud)

p是一个适用于值的简单打印

po基本上print object给出与NSLog