Hello World in Objective-C
My goal is to learn how to develop applications for the iPhone. Therefore, I’ll be learning Objective-C and I’ll be providing details on how that is going.
Overview of Objective-C
First of all, what is Objective-C? Objective-C is based on the OpenStep standard and is used primarily for Mac OSX, iPhone OS, and GNUstep. It can be compiled using gcc, which I’ll explain below.
Below is the HelloWorld.m program in Objective-C.
#import <stdio.h> int main( int argc, char *argv[]) { printf("Hello World\n"); return 0; }
*Objective-C programs have a .m extension.
Compiling Objective-C
Upon having Xcode, you may simply type the following to compile an Objective-C program.
gcc hello.m
That should print out the following:
Hello World
Congratulations, you just made your first program in Objective-C!


28. Mar, 2009 





thanks, do you have more posts like this?
can you please elaborate a bit more how to do the above, i.e – open xcode, new project (what kind?)… thanks!!!