I set the breakpoint at line 29, and I want to modify the value through LLDB to let him enter the == 1 situation, but I found that this breakpoint jumped to line 33 without hitting it, which is very strange.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let v = UIView.init(frame: CGRect(x: 100, y: 100, width: 300, height: 300))
v.backgroundColor = .yellow
view.addSubview(v)
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
let value = test()
print(value)
}
func test() -> Bool {
let m = 3
29 if m == 1 {
print(m)
return true
} else {
33 print(m)
return false
}
}
}
Where the breakpoint hit 29 but But the breakpoint jumped to line 33 without hitting
When I set the value of m to a random number, the breakpoint can stay at line 29, and the value can be modified to make him enter a different state, which makes me very confused
func test() -> Bool {
let m = arc4random()
if m == 1 {
print(m)
return true
} else {
print(m)
return false
}
}