Online Book Reader

Home Category

Objective-C Programming_ The Big Nerd Ranch Guide - Aaron Hillegass [3]

By Root 478 0
your skills.

For even more practice, there are exercises called Challenges at the end of each chapter. These exercises provide additional practice and will make you more confident of what you’ve just learned. I strongly suggest you do as many of the Challenges as you can.

You will also see sections called For the More Curious at the end of some chapters. These are more in-depth explanations of the topics covered in the chapter. They are not absolutely essential to get you where you’re going, but I hope you’ll find them interesting and useful.

Big Nerd Ranch hosts a forum where readers discuss this book and the exercises in it. You can find it at http://forums.bignerdranch.com/.

You will find this book and programming in general much more pleasant if you know how to touch-type. Touch-typing, besides being much faster, enables you to look at your screen and book instead of at the keyboard. This makes it much easier to catch your errors as they happen. It is a skill that will serve you well for your entire career.

How the life of a programmer works


By starting this book, you’ve decided to become a programmer. You should know what you’ve signed up for.

The life of a programmer is mostly a never-ending struggle. Solving problems in an always-changing technical landscape means that programmers are always learning new things. In this case, “learning new things” is a euphemism for “battling against our own ignorance.” Even if a programmer is working with a familiar technology, sometimes the software we create is so complex that simply understanding what’s going wrong can often take an entire day.

If you write code, you will struggle. Most professional programmers learn to struggle hour after hour, day after day, without getting (too) frustrated. This is another skill that will serve you well. If you are curious about the life of programmers and modern software projects, I highly recommend the book Dreaming in Code by Scott Rosenberg.

Now it’s time to jump in and write your first program.

2

Your First Program


Now that we know how this book is organized, it’s time to see how programming for the Mac and for iPhone and iPad works. To do that, you will

install Apple’s Developer Tools

create a simple project using those tools

explore how these tools are used to make sure our project works

At the end of this chapter, you will have successfully written your first program for the Mac.

Installing Apple’s developer tools


To write applications for Mac OS X (the Macintosh) or iOS (the iPhone and iPad), you will be using Apple’s developer tools. You can download these tools from http://developer.apple.com/ or purchase them from the Mac App Store.

After you’ve installed the tools, find the /Developer folder at the root level of your hard drive. This folder contains what you need to develop applications for Mac OS X desktops and iOS mobile devices.

Our work in this book is going to be conducted almost entirely with one application – Xcode, which is found in the /Developer/Applications folder. (It is a good idea to drag the Xcode icon over to the dock; you’ll be using it an awful lot.)

Getting started with Xcode


Xcode is Apple’s Integrated Development Environment. That means that everything you need to write, build, and run new applications is in Xcode.

A note on terminology: anything that is executable on a computer we call a program. Some programs have graphical user interfaces; we will call these applications.

Some programs have no graphical user interface and run for days in the background; we call these daemons. Daemons sound scary, but they aren’t. You probably have about 60 daemons running on your Mac right now. They are waiting around, hoping to be useful. For example, one of the daemons running on your system is called pboard. When you do a copy and paste, the pboard daemon holds onto the data that you are copying.

Some programs have no graphical user interface and run for a short time in the terminal; we call these command-line tools. In this book, you will

Return Main Page Previous Page Next Page

®Online Book Reader