How to Run Objective-C in Terminal?

You type commands after the $ (or %, depending on how your Terminal application is configured) on each line. If you’re familiar with using UNIX, you’ll find this straightforward.

At First, you need to enter the following lines into a file. You can begin by creating a directory in which to store your program examples. Then, you must run a text editor, such as vi or emacs, to enter your program:

sh-2.05a$ mkdir Progs    // Create a directory to store programs in
sh-2.05a$ cd Progs      //  Change to the new directory
sh-2.05a$ vi main.m    //   Start up a text editor to enter the program