Saturday, July 2, 2011

Hello World! Objective-C Terminal Version

I was having trouble really understanding programming for the iPhone and I realized it was because I did not have a good fundamental understanding of Objective-C. So I decided to start from the ground up and build a solid foundation of Objective-C before I started working with GUIs for the iPhone.

Goal: This tutorial will teach you how to write a simple Hello World! program on the command line.

1. Open Terminal
2. Create a Directory for Your Programs (i.e. mkdir programs)
3. Go to New Directory (i.e. cd programs)
4. Open up a text editor and create a file with extension .m (i.e. emacs filename.m)
5. Copy and paste the code below








5. Save the file and exit the text editor.
6. Type on the command line: 
7. If you did not get any errors then your program compiled correctly.
8. Now type:
9. You should seem something like this:






No comments :