Latest in Compile

Image credit:

iPhone Dev 101: Creating Xcode projects, brief Xcode UI overview

Cory Bohon

In our last iPhone Dev 101, a continuing series on iPhone development, we talked about resources that you can use while you are coding with Cocoa. In this dev post, I'm going to walk you through Xcode and creating your first project.

First we need to open Xcode, so once you have the SDK installed, you'll need to open /Developer/Applications/ and look for This is Apple's IDE (Integrated Development Environment) that allows you to code, debug, test, and build all of your iPhone and Mac applications. When you open this application, nothing specially really happens, although you might see the welcome center -- if you see this, you can choose to disable it at startup by using the check box at the bottom.

To create a new project, select File > New Project. In the resulting window select iPhone OS Application > View-based Application, and click "Choose." You will then need to specify a save name and location for the resulting files that will combine to create your application. In the resulting Xcode window, you should note that most of the work is already done for you!

At this point you have a fully functional application. Try it out: click the "build and go" button at the top of the window and wait while the app is compiled and opens in the iPhone Simulator. The app definitely doesn't do much, but still, it's a running application you made without writing any code.

Continue reading to learn more about Xcode, and get a brief UI overview.

If you exit the iPhone Simulator and return to Xcode, you'll notice the application is divided into many sections. In the left side pane you'll see "Groups and Files." This area is where all of your files that correspond to the project are stored; classes, frameworks, and resources can all be seen from here. In the top pane on the right, you'll notice files corresponding to the selected folder on the left. When you click on one of these files, the editor will be revealed in the bottom-right pane -- this allows you to write your code. You can double click on a file to bring up a larger, detached editor window.

Along the toolbar, you'll notice various icons. At the far left, you'll see a drop-down menu with a few options like "Simulator - 2.2.1 | Debug." These are the development SDKs/configurations that you can load. We'll mainly be using the one mentioned above because it allows you to easily compile your code to run in the simulator. When you click the "Build and Go" icon as we did above, this allows you to quickly compile and run your applications in either the simulator, or on the device if you have ad-hoc distribution set up (we'll cover this later).

As you can see, Xcode is like many Mac applications in that the UI is very simple and easy to learn. As we delve into the "Hello World" application in the next post, we'll go into more details about build configurations, and cover some basics with Interface Builder (Apple's UI development environment that ties into Xcode).

From around the web

ear iconeye icontext filevr