PDA

View Full Version : Cocoa App / XCode - no terminal output?!




Jayomat
Mar 18, 2009, 11:22 AM
Hi all,
im a newb with some java experience, playing around with the xcode. however, i just installed xcode and startet a new "cocoa application" projekt (macosx). i opened "Other Sources" => "main.m" and replaced the code in there with these lines:

#import <stdio.h>

int main(int argc, char *argv[])
{
int sum;

sum = 50 + 25;
printf ("The sum of 50 + 25 is %i", sum);
return 0;
}

when i hit "build and go", shouldnt that print the line "The sum of 50 + 25 is 75" on terminal ??? i dont understand why it doesnt work. can someone help me out?

thanks a lot!



Howiieque
Mar 18, 2009, 12:00 PM
the output display on the console. after build and go. Press command+option+r, you will see the result.

then check out the project folder, in the debug, you will find your app. run it. that goes to the terminal.

By the way, if you just want a command line thing, create a command line utility-->foundation tool.:)

Jayomat
Mar 18, 2009, 01:27 PM
By the way, if you just want a command line thing, create a command line utility-->foundation tool.:)

:cool:that's what i was looking for. as is said, newb;) gotta check it out.thx:)