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 8854193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:49:41+00:00 2026-06-14T13:49:41+00:00

i have a map application that inserts map pins when the user moves to

  • 0

i have a map application that inserts map pins when the user moves to certain locations, my question is how do i count the number of times the user has passed or has been on that same place.

Has in the following example:

User has been on place A with (latitude, longitude) five times.

Here is the code i have so far:

[outletMapView setMapType:MKMapTypeStandard];
                    [outletMapView setZoomEnabled:YES];
                    [outletMapView setScrollEnabled:YES];

                    MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
                    region.center.latitude = [[eachObject objectForKey:@"latitudeFrom"] floatValue];
                    //NSLog(@"latitudeFrom=%f",[[eachObject objectForKey:@"latitudeFrom"] floatValue]);
                    region.center.longitude = [[eachObject objectForKey:@"longitudeFrom"] floatValue];
                    //NSLog(@"longitudeFrom=%f",[[eachObject objectForKey:@"longitudeFrom"] floatValue]);
                    region.span.longitudeDelta = 6;
                    region.span.latitudeDelta = 7;
                    [outletMapView setRegion:region animated:YES];
                    /////
                    float longitude = [[eachObject objectForKey:@"latitudeFrom"] floatValue];
                    float latitude = [[eachObject objectForKey:@"longitudeFrom"] floatValue];

                    CLLocationCoordinate2D locationco = {latitude,longitude};

                    ann = [[DisplayMap alloc] init];
                    ann.coordinate = locationco;
                    ann.title = [eachObject objectForKey:@"setDepartureAirportOrCode"];

                    int count=0;
                    for(int j = aux; j < [objects count]; j++){
                        for(int k = j+1;k < [objects count]-j;k++){
                            NSMutableDictionary *item1 = [objects objectAtIndex:j];
                            NSMutableDictionary *item2 = [objects objectAtIndex:k];

                            NSString *str1 = [item1 valueForKey:@"setDepartureAirportOrCode"];
                            NSString *str2 = [item2 valueForKey:@"setDepartureAirportOrCode"];
                           // NSLog(@"%@==%@ ???",str1,str2);
                            if([str1 isEqualToString:str2])
                                 NSLog(@"%@==%@ MATCH!!!",str1,str2);
                                count++;
                        }
                    }



                    /* Contagem */

                    ann.subtitle = [NSString stringWithFormat:@"%d",count];
                    ann.coordinate = region.center;
                    [outletMapView addAnnotation:ann];

Sorry for my poor english, please dont down rate, any question or doubt just aks me im always online.

  • 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-14T13:49:41+00:00Added an answer on June 14, 2026 at 1:49 pm

    You could set up a region around each pin and tell the cllocationmanager to tell you when the device gets close.

    CLLocationAccuracy acc = kCLLocationAccuracyNearestTenMeters;
    [self.locationManager startMonitoringForRegion:aRegion desiredAccuracy:acc];
    

    When you get a callback (the delegate method didEnterRegion) you can increment a counter

    - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
    {
       NSLog(@"GeoFence: didEnterRegion");    
    }
    

    I’ll leave it to you to work out which counter you need to increment for each region

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

Sidebar

Related Questions

I have a silverlight application that contains Bing map. I want when the user
I have a google map component in my application that allows the user to
I have a map application that follows the user and what I want to
I have an application that shows locations on a map. I have created a
I am developing sample application that uses Google Map API. I have generated Google
I have a Web Application that displays a Map Service that is in NAD
In my Map application I have segment controller on main screen and using that
I have a 'black box' application that gets a map of values as parameters,
I have map application in which I have a button. On clicking that button
I have a map in my application that needs to be searchable by building

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.