iPhone Map Kit Tutorial

Here is a quick iPhone Map Kit tutorial that I showed during my presentation at the Vancouver iPhone developers meetup last Thursday. I have changed a few things based on the audience’s feedback. To contact me for training or software development please visit the website of my company Dynamic Leap Technology.

Step 1 – Show the World Map

  1. Create a new iPhone OS project: a Navigation based Application called “MapDemo”.
  2. Remove the RootViewController.xib file from the project (choose “Also move to trash”).
  3. Change the base class of the RootViewContoller in RootViewController.h to UIViewController.
  4. Add the MapKit framework. Click the Project->Edit Active Target “MapDemo” menu. From the Target Info dialog choose the General tab, and click the “+” button on the bottom. Select the MapKit framework and add it.
    Add the MapKit framework
  5. Double click to open MainWindow.xib in Interface Builder. Set the nib window to list view mode, expand the tree and select RootViewContoller.
    NIB window in list view modeIn the Attributes Inspector window remove the NIB name.Attributes Inspector
  6. In the MainWindow.xib window select Navigation Controller, and in the Attributes Inspector uncheck Shows Navigation bar.
    Attribute Inspector
  7. Drag and drop a map view on top of the Navigation Controller view.
    Navigation Controller View
  8. Save, compile and run.

Next Tutorial Page

Advertisements

2 Comments on “iPhone Map Kit Tutorial”

  1. Zee Says:

    I am a newbie to iPhone development and am trying this tutorial. When trying step 7 of this part, the MainWindow.xib displays a message “parsed 1 source file but no classes were found or changed”. Am I missing anything?

  2. Naeem Shah Says:

    i want to learn how to put pins at the tap area on map? can anybody give me the complete sample code or even some hints?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: