加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – 并非所有值对象都可以使用XCode Watch和Debug控

发布时间:2020-12-14 18:02:20 所属栏目:百科 来源:网络整理
导读:例如,由于某种原因在initWithNibName:bundle:我看不到self.view.bounds.size.width的值,必须停止程序并使用NSLog. 当我在手表中输入self.view.bounds.size.width时,我会在右侧显示“输入表达式”消息. 当我在调试控制台中键入print self.view.bounds.size.
例如,由于某种原因在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

有没有办法看到我使用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用于打印对象,它基本上给出与NSLog相同的结果

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读