I am new to xcode and I just have a quick question. In Visual Studio and Eclipse, I can add custom variables to a windows and watch its values during a debug session. I am looking for the same feature in Xcode 4, but I cannot find it. If it is possible in Xcode, could you please provide instruction so that I can do what I wish to do. If this is not possible, please let me know.
I am only able to find the window for variables that are "local", or "auto", or "all".
Thanks in advance.
Right click in that same window (that has the toggles for Local, Auto, All) and click Add Expression. Type in the full expression and click Done. The new watch expression should show when debugging in the window in the lower left with an E next to it.
Also, if you don't want to mess about with the IDE too much you can use gdb for this.
Click in the output window of the debugger and type po variable_name
and it will print out the value of that variable at that time.
e.g
(gdb) po mArray
(gdb) __NSArray
object1,
object2
... etc`
You can also use print variable_name
to get the value of a variable.
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