Objective C on Mac

I this section we will show you how to compile and run Objective C program on Mac machine.

Objective C on Mac

Objective C on Mac

     

I this section we will show you how to compile and run Objective C program on Mac machine.

Compiling Objective C on Mac OS x

To Compile Objective-C Programs on Mac OS X

This is a simple process to compile and run the code. Follow the steps given below:
1. Set path to the directory where hello.m saved and compile with the following command

 

 



$ gcc -o hello hello.m \ -L /System/Library/Frameworks/Foundation.framework/Foundation

Here -L option is used to locate the library files used in the code.

2. To run the code use the command..

$ ./hello

3. Output will be.....

2008-01-26 23:10:32.983 hello[381:10b] hello world!