I have an issue with the Xcode debugger. Everything works fine in general, I can print variables using po <var>
normally... Except in some files, where I can't print anything, and I have a error: Couldn't apply expression side effects : couldn't get the data for variable self
error in the console.
Weirdly, Xcode shows values correctly on the left debugger panel.
Does anyone have an idea?
Thanks!
If the variable is an image or other type that isn't expressible as text, click the Quick Look button at the upper-right to see a preview of the variable. Click the Print Description button to print a description of the object in the console.
In Swift, you can print a variable or a constant to the screen using the print() function.
When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.
Similar observations, all good on the left panel but printing ends with the same message. Quick improvement was to use:
po print(variable)
or
po debugPrint(variable)
Result - prints variable and appends the same error message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With