Categories
Articles

XCode 4 IPhone Mountains of the USA Tutorial: Overview

Welcome to the tutorial on creating the Mountains of the USA IPhone using XCode. The links to the completed lessons are located at the end of this post.

The tutorial examples uses the UINavigationController to manage the two screens. I built the first tutorial using a Window-Based Application project and then added the UINavigationController rather than use a Navigation Based project. This helped me understand the wiring of controllers to their interface counterparts and I believe provided a bit more flexibility. I learned to do this with Beginning iPhone 4 Development: Exploring the iOS SDK which was crucial to cracking the mysteries in writing IPhone apps.

The app will parse XML data containing the name, elevation, latitude and longitude of the highest 100 mountains in the USA. The XML data is loaded from a web server PHP script that allows for returning all 100 mountains or a selection above a specific elevation in feet. Then the location of any mountain is displayed in a map view.

Search Screen

Detail Screen

The first screen contains the user input to search for USA mountains based on their elevation and displays the results in a UITableView. Touching a mountain the UITableView opens the second screen where you can see the location of the mountain in a MapView with an MKAnnotationView showing the pin location on the map and a title.

Prerequisites: This is designed for beginners who have experimented with XCode and IPhone projects and who want work through an example that connects concepts into a useful app.

You need to have XCode installed. I used XCode 4 and IOS 4.2 for the tutorial projects. You can use XCode 3 however many screens and menus have changed for the better I might add which will make you dig a bit to find a panel or window. Otherwise the functionality you need is the same.
[ad name=”Google Adsense”]
You need to know how to build a basic hello world XCode IPhone project and run in the Simulator. You should have some basic practice using Interface Builder and adding IBOutlets and IBActions in Objective C.

You need to be a practicing programmer in some language. You do not need to be a ninja. A basic understanding of Objective C is helpful but if you have programming background, you should pick up on the Objective C nuances.

IOS Classes Used: In the tutorial you use the UINavigationController, UITableView, UITableViewCell, UITableViewCellStyleDefault, MKMapView, MKAnnotationView, MKPinAnnotationView, NSNumber, NSNumberFormatter, NSNumberFormatterDecimalStyle, UIActivityIndicatorView, UISlider, NSMutableData, NSMutableArray, UIButton, NSString, NSUInteger, CLLocationCoordinate2D, UIAlertView and NSXMLParser.

[ad name=”Google Adsense”]
Currently there are nine lessons and this will provide a table of contents for them as they get posted. You can register below and you will get notifications when new lessons are posted.