在xcode7调试器中发生了什么变化,我无法再使用“po”查看变量/ Swift [英] What changed in xcode7 debugger that I can no longer view variables with "po" / Swift

查看:305
本文介绍了在xcode7调试器中发生了什么变化,我无法再使用“po”查看变量/ Swift的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确定在xCode7 / Swift中有什么变化,我无法再使用po frame查看CGRect anylonger的内容?打印文件在代码中工作正常。如何在调试器控制台中无法像以前一样查看?

ok what changed in xCode7 / Swift that I can no longer use "po frame" to view the contents of a CGRect anylonger? The print statment works just fine in the code. How come I can't view that in the debugger console like I used to?

var frame = self.myLabel.frame

frame.origin.x = self.startingFrame.origin.x + translation.x
frame.origin.y = self.startingFrame.origin.y + translation.y

print(frame)

self.myLabel.frame = frame

但在调试器中,如果我打破了self.myLabel.frame = frame语句,并在调试器中使用po(或p或print),我得到:

yet in the debugger if I break on the self.myLabel.frame = frame statement and use po (or p or print) in the debugger I get:

(164.0, 323.0, 41.6666666666667, 20.3333333333333)
(lldb) po frame
error: <EXPR>:1:1: error: use of unresolved identifier 'frame'
frame
^~~~~
(lldb) p frame
error: <EXPR>:1:1: error: use of unresolved identifier 'frame'
frame
^~~~~
(lldb) print frame
error: <EXPR>:1:1: error: use of unresolved identifier 'frame'
frame
^~~~~
(lldb) 


推荐答案

这是Xcode 7.1中的一个错误。它固定在目前的7.2 beta,并将在最后修正。错误是,从C / ObjC模块导入Swift的Struct类型不适用于调试器(反过来它不会报告类型不可用的变量)。

This is a bug in Xcode 7.1. It is fixed in the current 7.2 beta, and will be fixed in the final. The bug is that the types for Structs imported from C/ObjC modules into Swift are not available to the debugger (and in turn it won't report variables whose types are unavailable.)

这篇关于在xcode7调试器中发生了什么变化,我无法再使用“po”查看变量/ Swift的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆