Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Object-C Newbie Question (http://www.mac-forums.com/forums/os-x-development-darwin/174448-object-c-newbie-question.html)

iMarco 11-04-2009 03:02 AM

Object-C Newbie Question
 
Edit: The "Object-C" was a typo, sorry...objective :)

Hello guys, I just got this great book (Programming in Objective-C 2.0) and I'm already working on the typical "hello world" program. I typed in the code, debugging ended normally on Xcode but I didn't get anything on screen. Here's the code:

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

// insert code here...
NSLog(@"Hello World");
NSLog(@"Hello World 2");
[pool drain];
return 0;
}

I pressed Build and Go and I got nothing. Was I supposed to get something on the terminal or anything?? Thanks!

Raz0rEdge 11-04-2009 08:02 AM

Open up the console and you'll see your NSLog messages appear there..

Regards


All times are GMT -4. The time now is 03:32 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.