Tom Pletzke: iPhone App Project 1

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

10 Δεκ 2013 (πριν από 4 χρόνια και 7 μήνες)

125 εμφανίσεις

Tom Pletzke:
iPhone App Project


Tom Pletzk
iPhone App Project

Tom Pletzk
iPhone App Project

By Tom Pletzke


Walsh College


Prepared for


Nan Poulios

Tom Pletzke:
iPhone App Project


iPhone App Project

10 weeks ago I did not know much about the Apple Mac operating system or ab
Mac’s in general. About six months ago I went with my boss to the store where he purchased a
Mini Mac pc. This computer had no mouse, keyboard, or monitor, and had a rather small
footprint. That is about the only contact I would have with the Mini M
ac until the iPhone project
started. I never heard of Xcode 4 or the IOS operating system. I did not own an iPhone and only
saw a glimpse of what they could do from my friends and co
workers. I knew nothing of the
storyboard environment that is now avai
lable in Xcode4 development. The reason I gave you
this background is to show that the process of iPhone development was completely new to me
and I was quite rusty on my object orientated programming.

I am a developer and programmer
of web applications s
o I do have some background that was helpful in this project. That said, the
entire process that is discussed in this paper is from a set of new eyes. My eyes were opened to a
new environment filled with challenges and pitfalls and discovery and frustrat
ion and

There will be much in this paper about programming Xcode and the new storyboard
environment. There is not much published or searchable for the new storyboard environment for
developing applications. I will try to fill those gaps wit
h examples. My entire source code will
be attached at the end of this document so don’t worry about missing something while reading. I
will be jumping around a little and filling in the programming with tips and general
programming strategy. Also, this
is a work in progress, and will be distributed on my web site
with updates as I further my journey into iPhone development. The application itself is not
finished because there are many features that would be nice additions. I will be including many
rences at the end of this document that do not have parts in the paper itself but I feel helped
in some way with my final product. I also purchased two books as part of this project to assist

Tom Pletzke:
iPhone App Project


with the concept of storyboarding because it was very new

and t
hese books are hot off the press.
One of them was not finished at the time I bought it but later downloaded the remaining chapters
to finish the book.

There may be a brief section in this paper for lessons learned, if not, here is
one that is relevant ri
ght now as I am writing this document. I put together a project plan that
gave me a week to spare in case the programming of code and testing fell behind schedule. The
good news was I was on schedule and the bad news is I only have one week to prepare th
presentation, write this how to create an iPhone app, and present at the Capstone fair on

Ok, and thirdly, if there was a secondly, I am writing this in story form with lots of
comments and suggestions that I feel will be meaningful. Like I s
aid before, if you want just the
code, skip to the end. Without further babble, here is the story.

Like I said, it all began about 10 weeks ago. My project was to create an iPhone app for
something. That was the first decision, what would the iPhone app

do? I turned to my interests
with sports, chess, security, database, and band. My first thought was doing look at one of my
interests that was online flight simulation and build an app for my flight group. I put together
everything that I thought would

be required and was sitting in my first class waiting to tell my
professor what my project was going to be about. Other students were presenting their ideas and
then I suddenly had a change of mind.

I had a better idea. Why don’t I do an iPhone app for

band that I am part of. It is one of my greatest thrills in life to play in a band. The band and I
call it our music therapy. I started to write about the screens I thought would be good to have.
What functions would make the app valuable. I look
ed at the advertisement value of the app and
before I knew it I was approaching my professor pitching the idea of the Lost City Band iPhone
This part of the story was important because your first iPhone project should be something
you are passionate
about because you will be spending a lot of time toying with your passion.

Tom Pletzke:
iPhone App Project


The professor


professor’s assistant
gave me good direction on where to start with
websites, screens, and functional ideas.

The first step was to bring my sponsor on board.

My sponsor would be my business
owner and would be approving and giving input to the content and functionality of the
I setup regular meeting with the business owner to help shape and give status on the
project and solicit feedback on proje
ct progress. The business owner is an important part of the
process for the method of
project management I selected. The method is called Scrum and is
part of the agile project methodology. This method of project management is not new to me as I
am a ce
rtified Scrum Master and have been using the scrum method for over 2 years at my
employment. There will be much in this paper about scrum and how it was used.

Next was the planning part of the project. This was difficult because I did not know what
I did

not know. I needed to plan a project when I did not know how I was going to complete the
work or what I was going to use to do it. So the first step was to do a little investigation into the
bare bones of iPhone development by researching the web, askin
g my peers, referencing books
using Books 24x7 online. After the initial investigation I was able to form a plan and tasks
needed to complete the project in 9 weeks.

As you will see during the development process
many of the tasks changed form as I learn
ed more about the topic. This is common when
working with new ideas and materials as your methods change as you learn. This learning
process and drag the project down if the new ideas and materials are not managed properly. For
example, at some point I
had to let go of the development phase of this project and lock the code
and functionality down so that there was and end. This sounds simple but it is difficult to stop
the ideas and complete the tasks already on the schedule. Ok, not stop the ideas, bu
t let’s write
the ideas down in a backlog for later review. Backlog is part of the scrum process and will be

Tom Pletzke:
iPhone App Project


discussed later in the paper.

Backup all your work. I will be putting this in the document
periodically. When you read this take the time now t
o organize your backup strategy and backup
your work.

My research on how to write an iPhone app started in two directions. The first direction
was using a program called Xcode4 that was only available on the Mac operating system. The
second direction was

using a program or coding environment called PhoneGap. I can’t speak
much about PhoneGap except for some initial research on the web and I found it looked
confusing compared to Xcode. However, I would not dismiss PhoneGap too quickly from your
because it might be a good way to go. I chose Xcode because it looked pretty straight
forward and somewhat similar to other programming environments and it seemed that PhoneGap
was still such new technology that all the bug were not worked out yet. Anoth
er part that was
interesting about PhoneGap is that you could develop in one language and port to the iPhone or
Android. That seemed to be an excellent feature but I did not have the time for a lot of research
into the PhoneGap technology and how it does
port to the iPhone. Would the interface be as nice
as the interface for

As I stated earlier, I do not own a Macintosh PC of any kind. What I needed was a Mac
PC that I could load Xcode on and then work on the iPhone app. I acquired a Mini Mac fro
m my
boss at work. He was kind enough to let me borrow it for the duration of my project. This was
an excellent start. A Mini Mac is a nice machine with more than enough power and connectivity
to develop my iPhone app.

The next step in the process is to

load Xcode onto the Mini Mac. I ran into some trouble
with this step. Xcode can only be downloaded by a registered Apple Developer. They do have
student licenses that can be given by your professor but I did not go that route for a couple of

Tom Pletzke:
iPhone App Project


One, I knew I was low on time, and even a couple of days delay could cause trouble for
me completing the project. If I became a developer I could download the software and start the
same day. The other reason was the student license would be limited. I
did not know exactly
how much it would be limited but I seem to have a knack for finding those types of limitations.
One such limitation may revolve around the ability to place the app in the iPhone store. I don’t
know for sure but I knew I could avoid t
hat sort of trouble buy purchasing the license for a year.
The cost was $99 and I justified it by the fact that my college capstone course did not require a
book. Later, you will find that I needed more cow bell, I mean, a couple of books. Excuse my


During this time I sent an email to an associated at work to ask how to develop
and iPhone app. He said that he did not have much knowledge on the subject but heard that the
Apple developer’s site had a lot of useful information. So I did m
ore research on the developer’s
site at Apple. I continued to reference the site and found it useful, but wordy. It was difficult to
find the perfect example. Most of this was caused by the fact that I would be choosing a new
technology called storyboar
d within Xcode and there are not many examples out there at this
time for storyboarding. It is a very good source for making your code function correctly and has
proven examples. I find that the internet is sometimes difficult to work with for programmin
examples because there are so many bad examples to be weeded out before you find the right
one. This is not saying that the web is a bad location to find examples as I found some excellent
examples in the weeds for my project. Books are the best source

for accurate examples of code
because they have been reviewed and corrected if necessary. For storyboard examples it was
difficult to find a good book because it is so new. I did find two very good books. One is “IOS
5 by Tutorials” by Ray Wenderlich a
nd the other is “iPhone IOS 5 Development Essentials” by

Tom Pletzke:
iPhone App Project


Neil Smyth. I used both these books for reference especially with storyboarding. Between the
two of them I used “IOS 5 by Tutorials” the most.

I turned the Mini Mac on to familiarize myself with th
e Mac operating system. Later I
will be referring to the term IOS which is the operating system of the iPhone. The desktop
reminded me a little of the Linux operating GUI. I am pretty good with computers so I became
familiar with the basics of the envir
onment. I have one big note to add here for those who are
more familiar with a Microsoft environment. The windows button on the keyboard is the CMD
button on the Mac. For example, CTRL
v to paste on the Microsoft environment is CMD
v on
the Mac environm
ent. The nice part if you sub the CTRL with CMD the other parts are about
the same for copy, paste, and cut. I worked on Microsoft by day and Mac by night so my brain
took a couple of minutes to adjust to the different keys

I hit the windows button
y times
paste text in windows and find the top start menu pop up.

Now that I was somewhat familiar with the Mac setup, I purchased an Apple developers
license at the Apple developers portal and downloaded Xcode. The file size for the download is

It is a big file that took about an hour to download or so and then I started the install
process. The install seemed to take forever, or at least a half hour before it just appeared to hang.
Now what? Without Xcode my project would be in trouble so I

tried the same install process
again and the same thing happened. So I went to the web and researched the problem and I
found an article that said you need at least 15 GB of free hard drive space to install Xcode4.
Well, I wonder how you find out about
free space in a Mac environment. The answer is you
click on the apple in the upper left corner and click about this Mac. Next, click more info and in
my case Serial
ATA. I found that I had 5 GB free before installing Xcode. I’m lucky the file
install fi
le even downloaded. So the next step was to hook up my Western Digital external hard

Tom Pletzke:
iPhone App Project


drive called a MyBook. This was a required part of my thought process from the beginning as I
knew I would need a backup but figured it would only be for my project file
s. Another tip for
backup, save and save and save often. Always backup your files at least on a daily basis and
have some sort of method for versioning. I used the date for example myprojectDec9a to hold
the project directory. You can apply the same me
thod to single files as well. You can also use a
versioning system like GIT. I will be discussing more about GIT later.

I plugged the external
hard drive in and it was recognized instantly but it was not formatted for the Mac. Be careful
here as I did
not need any existing information on the external hard drive. I knew it would be
safe to reformat it. By doing this I removed all the data from the external hard drive. You do not
have to do this but I will not cover what to do with a loaded external ha
rd drive in this article.
There is a utility for formatting and partitioning your external hard
drive Swiss Knife
Knife installed into the apps folder where I ran it from.
As you become more familiar with Mac
you will find the apps folding useful

along with finder and settings. I partitioned a big Fat32
partition on my external drive and began backing up pictures to recover some space. I found
some of the pictures where too big to copy to the drive because of limitations of the Fat32

So I created another partition in Mac format called MACSHARE that I put all backed
up files into. I knew if I used the Mac partition I would not have file issues. So after clearing
some space, I started the install again and the install appeared to be w
orking but was taking a
long time so I went to bed and when I woke up I found Xcode was installed.

It might have been
Xcode3 or Xcode4 but at the end of the day I am using Xcode4
. I did some initial looking at the
Xcode4 environment and found it difficul
t at first but maybe I could make my way through it.

Let me take some time and tell a funny story. I am not sure exactly when this happened
but I know it happened early in my project. I connected my iPhone to the system so I could

Tom Pletzke:
iPhone App Project


setup communication wit
h Xcode4 to my iPhone to download my app. The software said that
my iPhone was behind the version of Xcode4 and need to be updated. Seemed easy enough, so I
went down to my Windows PC and plugged my phone in and found IOS version 5. Yes, the IOS
that ju
st came out. I was in the middle of the massive iPhone update frenzy. Fortunately for me
it was very late at night and I received the update seamlessly in about an hour. I then thought to
myself how nice it was to have the new version 5. I went up to t
he Mini Mac and plugged in my
phone and the system said that my Xcode4 was behind my iPhone IOS. I just leaped over the
version on my Mini Mac. Back to downloading and installing Xcode. What else is there to write
about that other than if figures. Once

the Xcode4 update was done and all the planets aligned I
was able to make the connection from Xcode on the Mini Mac to my iPhone4. A dance was
done on my part, first of several during the project and I was left with the knowledge to be
careful when upgra
ding in the future to make sure the iPhone stays in sync with the Mac.
Basically, do not upgrade in the next 10 or so weeks would be the rule.

I used the Agile Scrum method for my project management. For this I downloaded some
templates for a burndown ch
art and other supporting Agile Scrum documents. There were also
other types of communication as well such as meetings and weekly status reports.

I will not
spend much time on this part of the process because I want to make sure I cover the code as
much a
s possible. I began looking at examples of other phone apps and especially any that did
screens similar to the ones I had in mind. For example, I did find a band app that I used to
bounce ideas off my business owner to see if we should include them in my

iPhone app. I call it
my iPhone app but it is really the ideas of others and me brought together to form the application
but for simplicity I am calling it my iPhone app.

One of the requirements I have read for the
iPhone app store is that you need to b
ring something unique to the table in order to get it

Tom Pletzke:
iPhone App Project


approved. I have always had that in the back of my mind but I think have a usable app will be
enough. Just the quick ability to see where the band is playing is a good motivation to have it
on the iPhone.

I met with my business owner and we drew how the screen would look and a rough
storyboard of the functions. Interesting how a storyboard is done in the design phase of a project
and there is something called a storyboard in Xcode4. That is

more than just a coincidence that
is why storyboarding can be done in Xcode4. At some point I had to decide whether to go with
storyboard or Nib design. Nibs existed before storyboards and you can actually mix the two of
them. Most of the examples you

will find on the web use the Nib. I did go the storyboard
direction but even late in the project I almost aborted them to the Nib method because finding
example of storyboard code was so difficult. Much of my programming was retro fitting what I
found i
n the Nib method to the storyboard method. It is not too bad but can be tricky at times.

One of the tough parts about Xcode4 is that sometimes you do something with drag and drop that
is not done in the programming code but without that connection your p
rogram will not work. I
will try to point those out.

I now have the basic screens and have formulated what I wanted to do as the basic design
after discussions with my professor and sponsor (business owner).
I wanted 4 basic screens
(Home, Band Bio, Ev
ents, and WebLinks). The Home page would show a picture and name of
the band. Before I go further I would like to point out that I needed this to be pretty simple for
the first version. Nothing too fancy, I only had 9 weeks. The Band Bio page would con
tain a
band bio that would be copied from our band website
. This will be done in a scrolling window
There would be an events page listing all the upcoming events for the band. In this first version
it will be listing all events in one view. In future
versions we will have 2 sections on the events

Tom Pletzke:
iPhone App Project


We will have o
for upcoming events and one
at the bottom for past
When you select one of the events in the table it will move to a detail page where all the
event information
will be displayed. This event table will only display the date and location to
keep the list brief.
The WebLinks page will also be a table and when the web site description is
selected it will go to the Safari browser and load the website.

I also want t
he application to be
database driven so if the iPhone is in a low connectivity area the information will display from
the last connection. I also wanted the business owner to be able to change the information
without reloading the iPhone application with
a new database. So I would need connectivity to
the web. I choose to read a URL from the band web site containing XML to load the database
with band and event information. The URL will contain the band bio, events, and web links. To
summarize this is a

database driven application loaded via XML from a webpage. This is the
end of the preliminary design. The next step is to break the design into groups and then sub
divide the larger tasks into more manageable parts. I broke the project into screen form
at tasks,
screen function tasks, database to screen tasks, XML to database tasks, and other tasks like
testing. I had different stages based on difficulty and relationship to each other. For example, I
saved the loading of the database from the XML for l
ast. If I could not get that part done the
iPhone would still function from the backend database and my presentation would still be
successful. I was decided by the business owner and myself up front that this is only phase one
of the iPhone app and woul
d require some additional time after the capstone presentation before
we submit it to the iPhone app store. This will be a free app in case I did not mention that.

choose the URL method of communication because I thought it was the easiest for me to do

under the tight timeline. I researched web services but I thought it would too difficult to setup on
the website side in the short timeframe. As it turned out the XML was a good choice because it

Tom Pletzke:
iPhone App Project


leads to something called RSS feeds that are basically XM
L. This is important because the band
site we use to schedule our events has an RSS feed option. For the next release I will be parsing
the RSS feed so the sponsor only needs to add events in one place. For phase one the business
owner will need to modi
fy an XML file.

This is the end of the writing for now. I will be
expanding on this and posting on my web site by February 2012. The web site will called