Programming Mac OS X with Cocoa for Beginners/Installing the developer tools

From Wikibooks, open books for an open world
< Programming Mac OS X with Cocoa for Beginners
Jump to: navigation, search

Previous Page: What is Cocoa? | Next Page: Getting around in Xcode and Interface Builder

Before you can begin, you need to install the developer tools. These are supplied on a separate CD or DVD with your OS X install discs. Find the CD and insert it. Because Apple works on the principle that developers need less hand-holding than the average user, the installer will not run automatically. Instead, you need to find the "devtools.mpkg" icon, and double-click it to run the installer.

Follow the on-screen instructions carefully. Make sure you have enough disk space available. At this stage, do not be tempted to customise the installation, just do a standard install which will give you everything you need (and more, but you may need it later).

Once the installer has run its course, you will find a new folder at the top level of your machine's disk, called Developer. Note — this is at the root level of the hard disk, not in your Home folder. To find it, you may need to open a Finder window and navigate to the disk itself, depending on how your Finder is configured.

Within Developer→Applications you will find a variety of folders, plus two applications, called Xcode and Interface Builder. These are the two main applications you will be working with throughout this text. You can ignore any others for now.

Double-click Xcode to launch it.

When Xcode starts, it defaults to multi-window mode which is not how this tutorial expects you to use it. In general, single-window mode is easier to use and avoids a confusing proliferation of windows as you work. To change it, before doing anything else, open the Preferences. Under General, choose "All-in-One" layout. In the same place, check the four boxes on the right - "Open counterparts in same editor", "Automatically open/close attached editor", "Automatically Clear Log", "Save Window State". Click OK.

It's also a good idea to make a folder for all the coding work you will do. This should be somewhere in your own Home area — you could make it directly under the Home folder, or perhaps within "Documents". It's up to you. Create the folder in the Finder wherever you want it, and name it "Projects". Xcode will make new folders inside this one for each new application we build.

Now we are ready to begin.

If you plan to work through this text, a good idea is to add the Xcode icon to the Dock for easy access. To do this, simply drag the Xcode icon in the Finder to the Dock.

Previous Page: What is Cocoa? | Next Page: Getting around in Xcode and Interface Builder