iOS App Development for Everyone

juggleroffbeatΚινητά – Ασύρματες Τεχνολογίες

19 Ιουλ 2012 (πριν από 5 χρόνια και 11 μήνες)

335 εμφανίσεις

iOS App Development

for Everyone

Kevin McNeish

Getting Started

Plugging into the Mother Ship

Welcome! This is the part of the book where you learn how to get yourself and your computer set
for App development and discover how to get the code samples that
come with this book. To be
clear, when we use the term

in this book, we are referring to Apple devices that run the iOS
operating system such as iPod Touch, iPhone, and iPad.

The Cost of Becoming an iOS App Developer

These days cost is a real considera
tion in any new venture. Fortunately, getting into iOS App
development isn’t going to break the bank, but there are definitely some costs involved.

First of all, you need to have a computer on which you can create iOS Apps (see the next section
for detail
s). If you already have the right computer, you have bypassed the greatest expense.
Even if you don’t, you can buy a brand new Mac Mini for just $568.95 if you purchase from
Amazon. Becoming a registered Apple Developer is free, but if you want to test you
r Apps on an
actual device (you do) and submit them to the App Store, you need to pay an annual developer
fee starting at $99. But you can wait to pay this fee until you have climbed the iOS App
development learning curve.

The phrase “it takes money to mak
e money” is very true in this case. There is a great potential for
getting a return on your investment as you sell Apps in the App Store, or even write Apps for
others. This initial investment is well worth it.

Getting the Right Computer for iOS App

Your first step in creating iOS Apps is to get a computer on which you can run Apple’s Xcode
development tool for creating iOS Apps in the Objective
C programming language that run on the
iPhone/iPad Simulator.

To run the OSX Lion version of Xcode, y
ou need an Intel
based Mac running Mac OS X 10.7.0
Lion or later. If you are still running Snow Leopard, you can install the Snow Leopard version of

If you want the least expensive Mac available, definitely check out the Mac Mini. The Mac Mini

a laptop computer, but it’s a very small (7.7 x 1.4 x 7.7 inches) and lightweight (2.7 pounds)
device to which you can connect your existing PC or Mac keyboard and external monitor. You
can get a Mac Mini for just $568.95, with no tax (depending on where
you live) from Amazon.
Make sure you get the newest 2.3 GHz Mac Mini model MC815LL/A. This model comes with 2GB
of memory and a 500GB hard drive. The processor speed (2.3 GHz) and the amount of memory
(2GB) dictate how fast your Mac Mini runs. Higher proc
essor speeds and larger memory increase
your speed. The size of the hard drive (500 GB) indicates how much information you can store on
your Mac Mini.

How much memory do you need on your Mac? The bare minimum is 2GB, but you should really
get as much as yo
u can afford. 4 GB of memory is much better, but if you plan to do a lot of App
development, definitely invest in 8GB. With 8GB you won’t spend time sitting on your hands
waiting for Xcode to do something!

Running  Mac  OSX  on  a  PC
Although it’s not official
ly recognized by Apple, you

run Mac OSX and in turn Xcode on a PC.
In every iOS class I have taught there is at least one student running Xcode on a PC. Although I
can’t advocate this approach because I haven’t tried running OSX on a PC myself, there a
re a
variety of tutorials on the web that show you how to do this. Just Google “Hackintosh” and you’re
in. Know in advance that this is not a simple process and it may be well worth your time and
energy to get a Mac Mini instead.

Registering as an Apple De
veloper (free)

It’s not until you register as an Apple Developer (free of charge) that you get access to all the
goodness that is Apple’s full iOS developer tools, documentation, and support forums. You can
download and install Xcode to create iOS apps in
the Objective
C programming language that run
on the iPhone and iPad Simulator as well as real iOS devices.

Here’s where you get started:

When you

navigate to this page you see a list of what you get as a registered Apple developer as
shown in
Figure 1

Figure 1:
All the goodness that comes from registering (free of charge) as an Apple Developer

As you can see, you get access to Xcode, as well as
the IOS SDK (Software Development Kit)
that includes a full suite of development tools.

The iOS videos and documentation are also good resources for learning about iOS development,
although most of them assume you already have a background in programming o
n the Apple

If you click the
Get Started

button, you are taken to the web page shown in
Figure 2
. If you
already have an Apple ID (you do if you have an iTunes account), you can use that same ID to
register as an Apple Developer. Otherwise, you c
an choose to
Create an Apple ID

Figure 2:

You need an Apple ID to register as an Apple Developer

After creating an Apple ID or using your existing ID, you are taken through a series of web pages
where you first enter your personal profile (name, compa
ny, address, phone, email).

Next, you are asked to complete a professional profile where you specify the Apple platforms you
develop with (you should select

on this page)

your primary market (business, education,
entertainment, and so on), the type

of iOS Apps you plan to develop, and your development
experience (if any).

The next web page displays a Registered Apple Developer Agreement that you can read and
sign. This includes verification that you are of legal age in the country in which you live.

After signing the agreement, a web page displays letting you know a verification code was sent to
your email address. You need to enter this verification code you received via email and click

as shown in
Figure 3

Figure 3:

To complete your
registration, enter the verification code you received via email

After you enter the code and press
, you are greeted with the happy welcome message
shown in
Figure 4

Figure 4:

It’s official…nothing quite like being officially in the program!

en you click

on this page, you are taken to the Apple Developer
Member Center

shown in
Figure 5

Figure 5
: Once you are a Registered Apple Developer you can join one of Apple’s Developer Programs

Here you will see an option to

in one of t
he Apple Developer Programs. You’re already a
registered Apple Developer so what’s this about?

Joining the iOS Developer Program

If you click the
Join Today

link in
Figure 5
, you will be taken to a web page that talks about
individual or company/organizat
ion developer programs.

To get full access to the complete iOS developer experience, including he ability to take the
training wheels off your Apps, run them on a real iOS device, and distribute them to the App
Store, you need to pay your fee (starting at
$99) to become part of the iOS Developer Program.

For this book, you only need to be registered (for free) as an Apple Developer. Since there is an
annual developer fee, you can choose to join an Apple Developer Program at a later date once
you’re past th
e initial iOS learning curve.

Downloading and Installing Xcode

To get to
the iOS Dev Center

where you can download Xcode, click the
link under

as shown in the web page in
Figure 5
. Ultimately, you will be redirected to download to
the Mac A
pp Store to download Xcode, but it’s free of charge to registered Apple developers.


installation file for Xcode is huge (although it


between versio
ns, it will be at least
over 1.4
GB). Depending on the speed of your Internet connection, plan f
or a relatively long
download time. Once you have downloaded the installation file, it takes only 5
10 minutes to
perform the actual installation.

Note that there are different Xcode downloads for the Snow Leopard and the Lion operating
systems, so make
sure you grab the correct download!

When you go to the Mac App Store, you will see a button in the upper left corner with the word

as shown in
Figure 6

Figure 6:
Click the

button to select Xcode to be downloaded

Click this button and the colo
r changes to green and the text changes to
Install App

as shown in
Figure 7

Figure 7
: Click the
Install App

button to begin the Xcode download

Click this button and you are prompted for your Apple ID
Figure 8


Before installing Xcode make sure you have plenty of disk space available (at least a few
gigabytes). If you don’t have enough disk space available, the Xcode instal
ler doesn’t always warn
you and simply displays a vague error message!

Figure 8:

Enter your Apple ID and Passwo
rd to verify your identity

After entering your Apple ID and Password, click
Sign In

the button in the App Store window
changes to say “Installing” (
Figure 9

Figure 9:

The button indicates Xcode is being installed

While Xcode is
, you can
do other tasks on your Mac.
If you want to check the installation
progress, click the

icon at the top of the App Store window and you can check the
amount of megabytes and time remaining

Figure 10

Figure 10:

Checking Xcode’s installation pro


installation is complete, if you are still on the main App Store panel, the text in the button
changes to

as shown in
Figure 11

Figure 11:

Xcode is finished installing

If you are on the App Store’s

tab, the

item also

shows it is installed


Figure 12:
Xcode shows “
” on the App Store’s


If Xcode doesn’t open automatically after installation, click


folder in your Mac
OSX Dock (the folder with the large letter A on it)
as shown in
Figure 13

Figure 13:
Select the Applications folder in the Mac OSX Dock

Next, click the

icon from
the popup list of applications shown in
Figure 14

(you may
need to scroll down to see it)

Figure 14
: Select the

n to complete the installation

The first time you launch Xcode you may see an Xcode Component Installation dialog that tells
you to install the
Mobile Device Framework

Figure 15
). If you see this dialog, click
, and
enter the id and password for y
our computer. It takes just a few minutes to install these files.

Figure 15:
Installing the Mobile Device Framework

When the Mobile Device Framework installation is complete, the
Installation Complete

appears (
Figure 16
). Click
Start Using Xcode



Figure 16:
Installation is complete!

You should now

see the Welcome to Xcode screen shown in
Figure 1

Figure 17

Xcode is installed and ready for you!

Now your computer is completely set up to begin creating iOS Apps!

Designing with Humans
in Mind

I know you’re itching to put fingers to keyboard and get on with the fun of creating your App, but
you should absolutely read
Apple’s iOS Human Interface Guidelines

document first. One of the
biggest problems in software development is forgetting a
bout end users. If you lose sight of the
people who will be using your App, you may create an App that is difficult to comprehend and

There is a reason why Apple has taken over the world with iOS devices in contrast with products
like Microsoft’s Zune

that are now acting as expensive paperweights. It’s because Apple has
designed the devices and Apps with humans in mind. And not just any humans

they are
designed for what Apple likes to call “the 80 percent”, or the majority of your users.

Sometimes it’s

hard to ignore the very vocal 20 percent of users, but if you fold on this point and
add complex features to please a smaller percentage of users, your App will not be easily used by
the other 80 percent.

I highly recommend you read this document thoroug
hly and keep it close in mind through the
entire adventure of building your App.