Changes

Jump to: navigation, search

Installing Xcode and Compiling Objective-C on Mac OS X

380 bytes added, 20:22, 25 September 2009
Compiling Objective-C from the Command Line
== Compiling Objective-C from the Command Line ==
While Xcode provides a powerful environment that will prove invaluable for larger scale projects, for compiling a running such as a simple application as the one we have been working with in this chapter it is a little bit of overkill. It is also a fact that some developers feel that development environments like Xcode just get in the way and prefer to use a basic editor and command line tools to develop applications. After all, in the days before integrated development environments came into favor, this was how all applications were developed. Whilst I'm not suggesting that everyone abandon Xcode in favor of the ''vi'' editor and GNU compiler, it is useful to know that the option to work form from the command line is available.
Using your favorite text or programming editor, create a file named ''hello.m'' containing the following Objective-C code:
</pre>
Save the file and then open a Terminal window (if you aren't already working in one) , change directory to the folder containing the source file and compile the application with the following command:
<pre>
2009-09-25 15:51:11.528 hello[3371:10b] hello world
</pre>
 
Compared to using Xcode that seems much simpler, but keep in mind that the power of Xcode really becomes evident when you start developing larger scale projects.
 
Before moving on to learning the basics of the Objective-C programming language, we will cover the installation and use of Objective-C on non-Mac OS X systems.

Navigation menu