ios – xcode debugger not exhibiting adjustments to variables


I’ve an IOS app and when I’m stopped within the debugger I don’t see adjustments to variables. I click on the > by self and see the variable and click on the > subsequent to it and see the worth. My code units it to a brand new worth. Within the debug window it doesn’t change. Within the code I print the variable earlier than and after I alter it, the prints work nice. I’m within the debugger wanting on the variable, it has the outdated worth, I step over the print and the brand new worth is within the console.

Plenty of stuff on stackoverlow references not debug or optimizing code. I’ve not touched something within the construct part and, so far as I can inform, I’m utilizing debug with no optimizations. I went into the settings for the app and debug was no optimization and I ran the app with no adjustments. I later went again in and located 2 locations that had optimization degree, in each locations I modified each strains to be no optimization, this modified nothing.

I constructed a brand new app and , I broke it on the first print, ran it, on the first print x had a price of 1 within the left window, it printed 1, I stepped over the subsequent assertion and the left window nonetheless confirmed a price of 1, it printed 2.
When it begins the console has no warnings/errors. simply says (lldb).

One unusual factor was that I’ve seen doc that claims should you hover over a variable it’ll show. When it’s broke I hover over variables, for over 10 seconds, and nothing occurs.

Model 14.3.1 (14E300c) of xcode and Model 14.3.1 (994) of the simulator. iPhone 14 Professional, IOS 16.4 simulated.

The brand new app is the default with an added @State variable and a button.

import SwiftUI

struct ContentView: View {
  @State personal var x = 1
    var physique: some View {
        VStack {
            Picture(systemName: "globe")
                .imageScale(.giant)
                .foregroundColor(.accentColor)
            Textual content("Good day, world!")
          Button ("hi") {
            print (x)
            x = 2
            print (x)
          }
        }
        .padding()
    }
}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles