Deep Blue Sea - My first iPhone app

Last year I was given the task of creating an iPhone/iPad application for a client. The only issue was that I had absolutely no prior experience in Objective-C or the Cocoa Touch framework. So armed only with a stack of books and Apple's API reference, I sat down and started learning.

Blindly approaching a fairly large project like this is a daunting prospect, so I started off cautiously implementing tiny pieces of functionality one at a time. The app's primary function was to display a large amount of data in a structured and easily navigatable way. Around 480 marine species and genera needed to be grouped into categories and filtered by various traits.

My initial inspiration for the app (named MarineLife) was the IMDB iPhone application which has a continuous process flow. When a button is tapped, a new view is pushed onto the Navigation Controller's stack which means you can essentially move through the app forever (or until your device runs out of memory).
I built a prototype of this design, but since the app is focused around the genus details, it didn't give enough focus on the genus itself and made it difficult for the user to understand which part should be the application's 'summit'. This can be explained by providing the iPod application which comes built into iOS as an example. The primary goal of any user using the iPod app is to play music. Everything up to the view in which the user can press 'play' is a path of filtering and sorting until the user finds the song they are looking for. The same methodology was applied to MarineLife. The view that the user aims for is the genus view which displays various pieces of information about that creature. Once a user reaches that view, they reach a dead end; in much the same way as when a user reaches the play button for a song in the iPod app, they can only move backwards through the view stack.

Apple provides a lot of helpful classes and it's amazing how simple it is to implement what seems like fairly complex mechanisms. Functionality such as the addition of the 'more' button on the Tab Bar when there are more than 5 items, is all handled automatically by Apple's TabBarController class. One thing that Apple doesn't provide on iOS is garbage collection, so you have to keep track of every bit of memory you allocate and release it yourself when it's no longer used. Xcode 4 contains an excellent code analysis tool which will attempt to spot memory leaks for you and even overlays arrows above your code to guide you through an object's journey from allocation to release.

The development of MarineLife went by comfortably with only a couple of small hitches that were easily solved by turning to Google. However, after launch, I was tasked with releasing an update which added a glossary function to the genus view.

I developed, tested and released without any problems, but soon afterwards I realised that I had made a pretty large error. iOS heavily caches the Core Data model which is important as it prevents the loss any existing data when an application update is released. Not realising this, I released the update containing the new glossary data which was incompatable with the old data model - causing the app to crash instantly on start up for those who updated from the original. After frantically trawling the documentation and the internet, testing and re-testing, I finally figured out how to tell the application to load a new model version by using lightweight migration (Detailed here).

If you are brand new to iPhone and iPad development, I suggest you read the following books from cover to cover:
Programming in Objective-C 2.0 by Stephen G. Kochan
iPhone Programming – The Big Nerd Ranch Guide by Aaron Hillegass


MarineLife for iPhone and iPad currenly resides on the iTunes AppStore and is free to download. Watch out though - it's a whopping 300mb due to the amount of images it contains.

Grow your business

Find out how Deep Blue Sky can grow your business.

  1. Digital benchmark
  2. Digital roadmap
  3. Digital engineering

Write a comment.