例如,由于某些原因在 initWithNibName:bundle:
中我看不到 self.view.bounds.size.width
的值,必须停止编程并使用 NSLog。
当我在 watch 中键入 self.view.bounds.size.width
时,我在右侧收到“输入表达式”消息。
当我在调试控制台中键入 print self.view.bounds.size.width
时,出现以下错误:
error: unsupported expression with unknown type
error: 1 errors parsing expression
有什么方法可以查看我可以使用 NSLog 看到的所有值吗?
编辑:根据@Abizern 的建议,尝试了 p self.view.bounds.size.width
和 po self.view.bounds.size.width
- 结果相同。
最佳答案
尝试
p self.view.bounds.size.width
或者:
po self.view
p
是一个适用于值的简单打印
po
用于 print object
,它基本上给出与 NSLog
关于objective-c - 并非所有值对象都可以使用 XCode Watch 和 Debug 控制台查看,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18848229/