My goal is to change value of let for debugging purposes. I'm able to set the breakpoint and evaluate new value, but this new value isn't used by print statement.
private extension UIAlertController {
@objc func textDidChange() {
guard let firstTextField = textFields?.first,
let name = firstTextField.text, name != "" else { return }
let normalizedString = name.capitalizingFirstLetter().pascalCasedStringForSeparator("-")
print("----")
print("name is \(normalizedString)")
}
}
I have a breakpoint for the line #06 just before the last print statement.
Next step is to verify current value for the name. It's "Hfg". So far so good.
Next step is to set new value by invoking e normalizedString = "!!!!!" command.
My expectation is the last print statement should print "name is !!!!!" instead of "name is Hfg" but it's not.
Terminal output is:
(lldb) e normalizedString
(String) $R4 = "Hfg"
(lldb) e normalizedString = "!!!!!"
(lldb) e normalizedString
(String) $R8 = "!!!!!"
----
name is Hfg
(lldb) e $R4
(String) $R10 = "Hfg"
(lldb) e $R8
(String) $R12 = "!!!!!"
(lldb)
Variables view window display the new value for the normalizedString but print command doesn't use that value.
How can I force the App to actually use that new value for print command, what I'm missing here?