On Dec 21, 2012, at 12:46 , "Theodore H. Smith" < email@hidden> wrote: I press the "Run" button on the top-right of the screen, and... nothing happens. Well actually, the bottom of the window flickers, for a moment I can see the "console window" appear, and then disappear. as if my program ran in 0.05 of a second or something.
BUT I coded my program explicitly, to run for 10 seconds! So something is wrong, it should not just run in 0.05 of a second!
I tried adding an "exit(-1)" at the start of my main function. And... re-run, nothing. No error. The program runs just fine.
Is there any reason you can't set a breakpoint in your main () and step through your code? That procedure hasn't changed from Xcode 3 in any significant detail. I tried finding the shell tool I just built, and it's not in a build folder next to the project like it used to be. Much to my dismay, it was buried somewhere in "Users/theodore/Library/Xcode". I tried running it directly via Terminal, and... same thing, it just completes normally as if I didn't enter "exit(-1)" at the start of my program.
Yes, it's a conceptual change in Xcode 4. Everything in the "buried" derived data is (sort of) private to Xcode, or at least (sort of) intermediate. Xcode doesn't build the final "product" unless it has to, for example when you choose "Archive" from the "Product" menu. Note that an ordinary build doesn't run any build phases that are marked as "run only when installing", which is why your executable doesn't get copied from the derived data to somewhere easier to find, on a normal build.
If you want to be retro, you can also (through a combination of workspace settings and preferences) configure Xcode 4 to use a build folder of the Xcode 3 variety.
But all of that seems unnecessary. You should be able to solve the original problem from within Xcode and the debugger. Note that if the console pane disappeared when execution finished, you can re-display it using View -> Debug Area -> Show Debug Area, and it should still contain any log messages that execution produced. You can also change preferences (Behaviors pane) to prevent the debug area from hiding if it contains any messages at the end of execution (or at all, if you wish).
|