Search code examples
swiftxcodebreakpoints

Get bogus value when execute break point in a variable


Code

I got a bogus value of finalScore, what happened?

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


Solution

  • 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.