views:

182

answers:

1
int main()
{
    cout << "Buy or sell (b/s): " << endl;
    string buy_sell;
    cin >> buy_sell;
    .....
}

when i try to step through this in Xcode, i just stops at the cin >> buy_sell line, because it's waiting for the user input. How do i enter the value i want in the debugger so i can move past this? I'm using Xcode 3.2.1.

(I know i could just comment out the cin lines and define the variable in the code for debugging purposes, but that would be very tedious, and i feel like there should be an easy way to enter input that i just don't know about.)

A: 

Are you using the XCode console? You can access it under the "Run" menu, just below the Debugger. The shortcut is command-shift-R. From there you can interact with the application exactly like a terminal, but from inside of XCode itself.

Oz
Ah, i see. I was using the console, and i actually just figured this out myself a few minutes ago. Its tricky, because you have to wait 5-10 secs between clicking step over and when you can type in the input in console. (if you try and type stuff before then, its just in gdb). And the step over and step into buttons become gray and unclickable, so i thought there was something wrong with the debugger.
adam n