Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7903999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:53:07+00:00 2026-06-03T09:53:07+00:00

I’m new to iPhone development. I’ve been reading several questions on how to make

  • 0

I’m new to iPhone development. I’ve been reading several questions on how to make a google maps annotation callout window accept line breaks. Every tutorial I’ve read requires me to fire the mapView:didSelectAnnotationView method. But I have no idea how to trigger this. things I’ve tried include

  • putting the method in my MapViewController.m file which extends UIViewController
  • putting the method in a MapView.m file which extends MKMapView, then have my Mapview element in my storyboard reference it as the class to use

There’s so much about xcode, objective c, and iphone development that I don’t understand, so i can’t tell where my problem lies.

At the moment, my map does plot my desired marker on the desired location. I just need to understand how to fire the mapView:didSelectAnnotationView and mapView:viewForAnnotation functions before I can start customizing the call out box.

Does anyone have step by step instructions on how to trigger these functions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:53:08+00:00Added an answer on June 3, 2026 at 9:53 am

    A bit of background

    A few things to note:

    1. You don’t call mapView:didSelectAnnotationView. The MKMapView calls that function on it’s delegate. In other words, when you set up an MKMapView, you tell it: “hey, listen, anytimme you need to tell me what’s happening on the map, go tell this guy, he’ll handle them for you”. That “guy” is the delegate object, and it needs to implement mapView:didSelectAnnotationView (that’s also why its name “did select”, ie, it already happened, as opposed to “select”). For a simple case, the delegate is often the UIViewController that owns the MKMapView, which is what I’ll describe below.

    2. That method will then get triggered when the user taps on one of your annotations. So that’s a great spot to start customizing what should happen when they tap on an annotation view (updating a selection, for instance).

    3. It’s not, however, what you want if you want to customize what annotation to show, which is what it sounds like you’re actually after. For that, there’s a different method just a few paragraphs earlier on the same man page: mapView:viewForAnnotation. So substitute this method if you find that mapView:didSelectAnnotationView isn’t what you were looking for.

    What you can do

    If you got as far as a map with a marker, I’m guessing you have at least:
    * a view controller (extendeding from UIViewController, and
    * an MKMapView that you’ve added to the view for that view controller, say named mapView

    The method you want to fire is defined as part of the MKMapViewDelegate protocol.
    The easiest way to get this wired is to:

    • make your UIViewController the delegate for you MKMapView

      • in code, say in your viewDidLoad, of your MapViewController.m you could do mapview.delegate = self, OR
      • in Interface Builder, you could drag the connection from the the MKMapView delegate property to the file’s owner
    • then, define a method on your UIViewController called mapView:didSelectAnnotationView, declaring it just like the protocol does, in your MapViewController.m file:

      - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view {
          // whatever you need to do to your annotation and/or map
      }
      

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.