Search code examples
xcodexcodebuild

xcode: calculate expression when Debug


Can Xcode calculate the value of an expression while debugging?

I mean like MS visual studio, there is a "watch" window, where the debugger can input expressions composed with the local variables, and vs will calculate the value. can similar thing be done also in xcode? how?


Solution

  • Use the Run/Show/Expressions window. You can also use the print (or p) command in the console window (the one with the (gdb) prompt).