【发布时间】:2020-06-25 05:50:46
【问题描述】:
环境:Xcode 11.3.1/Swift 5
函数如下:
func lldbTest() {
var switchInt = 1
...// do something and set a break point here
if switchInt == 1 {
print("switchInt == 1")
} else if switchInt == 2 {
print("switchInt == 2")
}
}
在进入if语句前调试,在lldb中将switchInt改为2
e switchInt = 2
p switchInt
(Int) $R4 = 2
但它仍然打印“switchInt == 1” result
【问题讨论】: