For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Download from Wow! eBook <www.wowebook.com>
iv
Contents at a Glance
Contents .............................................................................................................. v
Foreword: About the Author .............................................................................. ix
About the Contributing Authors ........................................................................ xii
About the Technical Reviewer ......................................................................... xiii
Acknowledgments ............................................................................................ xiv
Preface .............................................................................................................. xv
■Chapter 1: Before We Get Started .................................................................... 1
■Chapter 2: Blast-Off! ...................................................................................... 33
■Chapter 3: Keep on Truckin’ .......................................................................... 57
■Chapter 4: Buttons & Labels with Multiple Graphics ................................... 101
■Chapter 5: Touches ...................................................................................... 155
■Chapter 6: Switches .................................................................................... 217
■Chapter 7: Storyboards ............................................................................... 255
■Chapter 8: Debugging .................................................................................. 325
■Chapter 9: MapKit & Storyboarding ............................................................ 361
■Chapter 10: MapKit & Tables with Storyboarding ...................................... 431
■Chapter 11: Storyboarding to Multimedia Platforms .................................. 487
Index ............................................................................................................... 521
1
Chapter
Before We Get Started
This introductory chapter will ensure that you have all of the required tools and
accessories to proceed fully and confidently through this book. Some of you may
already have Xcode, an up-to-date iOS simulator, and Interface Builder installed on your
Mac and you may believe that because you are solid on these points, you are ready to
jump right in. If so, you may want to jump ahead to Chapter 2 and start immediately on
your first program.
It will behoove you, though, to understand why I teach certain things and skip over
others. For those of you who have never programmed in Objective-C, it is quite a
challenge—even for my engineering students who know Java, C, and C#. Nevertheless,
with the appropriate preparation and mindset, you will accomplish programming in
Objective-C.
So—I urge you to read on. The time you will invest in this chapter will be well worth it in
peace of mind and confidence. Chapter 1 will help to structure the way that your brain
will file away all of the rich content that is to come.
Necessities and Accessories
In order to program for the iPhone and/or iPad, and to follow along with the exercises,
tutorials, and examples presented in this book, you’ll need to have 5 minimal
requirements. You may not completely understand them right now, but that’s OK—just
roll with me for a second. I’ll explain everything as we go through these steps. Briefly,
the 5 you need are:
A Mac
The correct operating system for your Mac called an "OS X"
Registration as a developer (discussed in detail below)
The correct operating system for your iPhone, called an iOS
The correct Software Development Kit for your iPhone, called an SDK
that runs a program called Xcode.
1
CHAPTER 1: Before We Get Started
2
Let's go into some of these in a bit more detail.
First, you will need an Intel-based Macintosh running Lion (OS X 10.7.2 or later). If your
system was bought after 2006, you’re OK. I purposely program everything on a
MacBook bought in 2006. All of the videos on the net are screencast from either my
MacBook from 2006, or if I broadcast from my 2010 iMac, I first run it on my MacBook
bought in 2006. You don’t need the latest revved up Mac. If you haven’t bought one yet,
I suggest you get a basic, no-frills MacBook Air. If you do own an older Mac, then you
may be able to add some RAM. Make an appointment at the Genius Bar at an Apple
Store and ask them to increase the RAM as much as possible. Also, ask them explicitly:
"Can this old computer run Lion at least 10.7.2, iOS5, and Xcode 4.2 or later?"
If you do not have a Mac, then keep in mind that, as mentioned, I have made a point to
code and run every program in this book on Apple’s smallest and cheapest model, the
MacBook. Apple has discontinued the MacBook; they now sell the MacBook Air for
$999, which is more advanced than the Author's MacBook. You can purchase a
MacBook on eBay and other such sites. See Figure 1–1.
Figure 1–1. I use the cheapest 2006 Mac on the market, the MacBook, to perform all the coding and compiling in
this book. Essentially, there is no need at all to buy a more expensive or higher-end Mac to perform all the
exercises.