Weird debugger issue

I have a simple if statement

If x > 15000 {
let z = 2
}

The problem is that the let statement is called when the debugger shows that the value of x is 424.

Any thoughts as to what could cause this?

Thanks!
I cannot reproduce the issue with using the code you have shown.
(I needed to replace If to if, but other than that, exactly the same.)

Can you explain more detailed steps till you get that weird result?
You should instrument the code:

Code Block
if x > 15000 {
let z = 2
print("x=", x)
}

And tell what you get for x = 424
Are you sure the x you see in debugger is the x of the if statement ?

May be you have declared x twice in code.
Could you show more code ?

Or the value you get in debugger is not captured at the same time as the one in if.
Before entering 424 for x, did you enter a value over 15000 just before ? And the update of x from textField not done when test occurs ?
The problem has disappeared after I did something. Not sure what but possibilities include restarting Xcode.

I'm assuming that something in the debugging environment had been corrupted.

Thanks for all your help!
Weird debugger issue
 
 
Q