Tutorial 2-1: Introduction to Object Oriented Programming
I know you are probably itching to get stuck into the iPhone programming environment, but there are a few things you HAVE to learn first. One of them is Object Oriented Programming. The reason I am jumping right into this is that it is the main feature of Objective-C and a very powerful set of tools which you will need to understand if you want to create iPhone apps.
Let’s start by creating a new project in XCode. Fire up XCode and follow these steps:
- In XCode, click File > New Project
- Choose Command Line Utility > Foundation Tool
- Name the project “Objects Intro” and save it.
In the project window, click the Source folder in the left-hand pane to view your source files. You should have one called “Objects Intro.m” and one called “Objects Intro_Prefix.pch” (which you can ignore for now.)
Object oriented programming languages are based around the use of objects. Objects can represent real life objects (like a chair or a car), or can be more abstract. Objects can hold variables, change variables and pass information between each other. This makes the development of complex applications much more simple. You will understand them more as we continue. Let’s make an object right now!