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

  • Home
  • SEARCH
  • 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 7695549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:34:11+00:00 2026-05-31T21:34:11+00:00

I am interacting with the Google Places API and I am trying to get

  • 0

I am interacting with the Google Places API and I am trying to get the list of coordinates of the restaurants, and display them in the mapView as pins. I also want to create a callout for it.

What I have done so far is: Get the longitude and latitude of the locations (along with name and address), store them in an Array, and I do

[self.nearmapView addAnnotations:self.AnnoArray];

The MapView display the pins as Red although in my below method I had it as Green.

- (MKAnnotationView *)mapView:(MKMapView *)theMapView 
        viewForAnnotation:(id <MKAnnotation>)annotation 
{
    customPinView.pinColor = MKPinAnnotationColorGreen;
}

It was even crazier when I commented the above method, the mapView can still generate the annotation pins (so the above method wasn’t called at all).

How do I fix this?

Does anyone know how to use storyboard to make annotation connection with segue?

  • 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-05-31T21:34:12+00:00Added an answer on May 31, 2026 at 9:34 pm

    If you don’t implement mapView:viewForAnnotation:, or if for some reason it’s not getting called, you get the default red pin view.

    You can make sure your mapView:viewForAnnotation: is getting called by sticking an NSLog at the top or setting a breakpoint. If you find it’s not, you may have failed to hook up your delegate. There’s more than one way to do this, but often it’s done like so:

    1. The view controller managing the map view declares conformance to the MKMapViewDelegate protocol: @interface MyViewController : UIViewController <MKMapViewDelegate>
    2. That view controller is set as the map view’s delegate (e.g. with self.mapView.delegate = self in viewDidLoad, presuming you have a property mapView pointing to the map view).
    3. That view controller implements mapView:viewForAnnotation:.

    If you do step 3 without steps 1 and 2, your mapView:viewForAnnotation: will never be called.

    If the mapView:viewForAnnotation: you’ve posted is the entire implementation and not an excerpt, I can see why it’s not working — you’re not returning the instance of MKAnnotationView that you’re setting the color on. You need to return an actual view, and it needs to be a new instance for each distinct annotation.

    As for storyboarding — obviously your annotations aren’t visible in IB, so you can’t drag segues from them. Instead, drag a segue from the view controller itself (the one managing the map view), and give it an identifier. Then, when the annotation’s button is tapped (which invokes the delegate method mapView:annotationView:calloutAccessoryControlTapped:), your view controller can call [self performSegueWithIdentifier:@"yourIdentifier"] to make it happen. (You don’t get access to the segue’s destination view controller at that time, so you can’t configure it based on which annotation was tapped. But you can remember which annotation it was and then use it in prepareForSegue:sender:.)

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

Sidebar

Related Questions

I am trying to get to grips with interacting with the GA API v3
I'm interacting with the Magento API and after calling: $result = $soap->call( $session_id, 'catalog_product.list'
I want a chart api that can work almost like google stock market chart.
I want to search places like google map in my app with using MKMapView.
I'm trying to getting this http://www.forgottenexpanse.com/projects/ci_reader CodeIgniter library for interacting with Google Reader to
I am trying to create Google Chrome extension that will send interesting links to
I've been working with this plugin: http://www.neilcrookes.com/2009/09/27/get-google-analytics-data-in-your-cakephp/ but honestly it's over my head. Under
I'm working now on google maps, I'm trying to build something not even half
I'm trying to get a sense of how to implement the user/role relationships for
I am trying to create an overlay of creases on top of a Google

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.