【发布时间】:2019-04-26 14:09:09
【问题描述】:
请帮帮我,我是 Swift 新手。
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
var flag = false
print(" current-> \(flag)") /** Add a breakpoint **/
if flag == true {
print(" after -> true")
}else {
print(" after -> false")
}
}
我想用lldb来修改'flag'的值,所以,
(lldb) po flag
false
(lldb) expression flag = true
(lldb) po flag
true
(lldb) continue
2018-11-24 23:57:05.552804+0800 test_swift_lldb[6806:384106] XPC connection interrupted
Process 6806 resuming
current-> false
after -> false
好像没什么用。 请告诉我如何使用lldb,修改bool值。
【问题讨论】:
-
您好,请将您的代码输入为文本,而不是外部图像。您正在尝试使用调试器,对吗?看看这个答案是否有助于输入调试器命令:how-to-change-variables-value-while-debugging-with-llvm-in-xcode
-
@Bill 你有什么好主意吗?我对这个问题感到沮丧......
标签: swift