ARTICLE

Annotation Pin in iPhone or iPad

Posted by Sachin Bhardwaj Articles | iPhone/iPad November 21, 2012
In this article I will explain process of implementing map and show location using notation pin in iPhone or iPad.
Reader Level:
Download Files:
 

 Introduction

In this article I will create a Single View application. Here I use a map view from xib and write a code for implementing an annotation pin. Using this we can determine the location of the device.

To understand it we use the following procedure.

Step 1

Open XCode by double-clicking on it.

Select-xcode-in-iphone.jpg 

Step 2

Create a New XCode Project by clicking on it.

create-project-in-iphone.jpg

Step 3

Now Select Single View Application and click on Next.

single-view-application-in-iphone.jpg 

Step 4

Now provide your Product Name and Company Identifier.

project-name-in-iPhone-iPad.jpg 

Step 5

Select the location where you want to save your project and click on Create.

save-project-location-in-iphone.jpg

Step 6 

First we add the framework MkMapkit which is required to show the location.

To import this framework we use the following.

Step 7

Click on project and select Build Phase.

build-phase-in-iPhone.jpg 

Step 8

Click on the "+" icon to add a framework.

Step 9

Write on search bar mapkit and click on add button.

add-mapkit-framework-in-iPhone.jpg

Step 10

Now we write code and add a mapview from xib.

annotation-pin-code-in-iPhone.jpg
 

linking-in-iPhone.jpg
 

Step 11

Click on the run button to show output.

Step 12

Output in iPhone:

Output-in-iPhone.jpg

Output in iPad:

Output-in-iPad.jpg

Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.