Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I find out the return value before returning while debugging in Xcode?

Take the following function:

func go() {
    return someTablePresenter.getSomeData();
}

When I set a breakpoint in this function, is there a possibility to inspect the returned value?

The only way to inspect the returned datatable is to use a temporary variable. However, that's a bit inconvenient.

Question: Isn't there another way?

like image 956
Blazej SLEBODA Avatar asked Nov 30 '18 10:11

Blazej SLEBODA


People also ask

How do you find the return value?

There are 2 places where we can see the method return value: In the Debugger Immediate window, using the $ReturnValue keyword. To open the Immediate window while debugging, choose Debug -> Windows -> Immediate (or press keyboard shortcut: Ctrl + Alt + I). In the Debugger Autos window.

How do I see return value in Visual Studio?

View return values for functions If the window is closed, use Debug > Windows > Autos to open the Autos window. In addition, you can enter functions in the Immediate window to view return values. (Open it using Debug > Windows > Immediate.)

How do you evaluate expressions in Xcode?

Use the po command in the Debug area Set up a breakpoint on the relevant area of code, then when the program stops at the breakpoint, enter commands in the Console in the Debug Area. The relevant command is po (print object) followed by the expression you want to evaluate.

How do I debug in Xcode step by step?

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.


1 Answers

If you tap 'step out' then a 'return value' will appear in the debugger variable view source

like image 143
Ben Avatar answered Sep 25 '22 13:09

Ben