Will Beethoven Will Beethoven - 1 year ago 111
Swift Question

Get bogus value when using break point before a variable in Swift


I got an bogus value of finalScore, what happened?

I want to know why finalScore is 4339953456 rather than a correct number 520.

Answer Source

Your breakpoint is on the finalScore = line, it means that the program is stopped before this value has been computed.

It should show no value instead of a bogus value, probably, but this is not something that you have to worry about: set your breakpoint one line later and your finalScore will have a proper value.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download