I'm having a very weird problem - as you can see in the picture below, the debug shows that the program entered to the if statement, but the value of color is shown as nil !!!
obviously that's can't be true, and I suspect that the Xcode is showing incorrect values on the inspector \ variable view (at the debug area).
I have no idea - maybe my Xcode had too much vodka?
any HELP please???
updates:
There is 2 ways to watch a variable and break at certain condition. Control-click a breakpoint indicator to display a command menu and choose Edit Breakpoint to open the breakpoint editor and set conditions, add actions, and so forth, as mentioned in Breakpoints. Use LLDB command line.
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.
Print a variableClick the Add Action button and select Debugger Command. Put any print command in a debug console in a text field. Make sure you prefix it with po , e.g., po print(view) . Check Automatically continue after evaluating actions.
I've seen the "extracting data from value failed" message (when doing a po foo
at the LLDB prompt), even on debug builds . This appears to be an LLDB bug.
A workaround that worked for me was to cast the value to the expected return type (e.g. if it's an NSNumber, po (NSNumber *)foo
).
Check your scheme - Run tab on the left should have the Debug executable option checked.
If you are running on AdHoc \ Release mode, the debugger will not show the right values.
Change the "Build Configuration" to "Debug".
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