xcode - xcode7 调试器发生了什么变化,我无法再使用 "po"/Swift 查看变量

标签 xcode debugging variables swift2 lldb

好吧,xCode7/Swift 发生了什么变化,我不能再使用“poframe”来查看 CGRect 的内容了?打印语句在代码中运行得很好。为什么我不能像以前那样在调试器控制台中查看它?

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),我会得到:

(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 的结构类型对于调试器不可用(反过来它也不会报告类型不可用的变量。)

关于xcode - xcode7 调试器发生了什么变化,我无法再使用 "po"/Swift 查看变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33994292/

相关文章:

ios - Mogenerator和Xcode 4优点/缺点

ios - Xcode 11 GM Seed 工具链无效

C# 变量命名

ios - Swift 2.0 UIImagePickerController 在关闭时关闭父 View

ios - Xcode 6.4 导出临时 "Session has expired"

android - Android-Logcat错误

macos - OSX Catalina 上的 gdb 8.3.1 "not in executable format: file format not recognized"

python - VS Code Python 调试。如何从错误中继续。更改后从行重复

javascript - PHP 检查文本框是否包含链接

variables - IntelliJ : How to auto-highlight variables like in Eclipse