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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:15:54+00:00 2026-06-12T20:15:54+00:00

It may sound weird but I am facing a problem in calling a same

  • 0

It may sound weird but I am facing a problem in calling a same block of code twice for different values. When the same code is repeated, I found that the first one only gets executed while second one is not even called. Please help

-(void) showRestaurants {
if (!self.geocoder) {
    self.geocoder = [[CLGeocoder alloc] init];
}

            NSArray *web = [detail valueForKeyPath:@"Address"];
            NSLog(@"NO OF VALUES^^^^^^^^^^^^^^:: %@", web);
            int count = [web count];

            NSString *value;

//Other place of interest nearby
            for (int i = 0; i < count; i++)
            {
                 value = [web objectAtIndex:i];
                NSLog(@"==> %@", value);
                [self.geocoder geocodeAddressString:value completionHandler:^(NSArray *marks, NSError *failed) {
                    if ([marks count] > 0) {
                        NSLog(@"call Me....");
                        CLPlacemark *placemark = [marks objectAtIndex:0];
                        location = placemark.location;
                        coordinate = location.coordinate;
                        coordinate.latitude = location.coordinate.latitude;
                        coordinate.longitude = location.coordinate.longitude;

                        //for first co-ordinate :: SOURCE
                        MKCoordinateRegion newRegion;
                        newRegion.center.latitude = coordinate.latitude;
                        newRegion.center.longitude = coordinate.longitude;
                        newRegion.span.latitudeDelta = 0.029321;
                        newRegion.span.longitudeDelta = 0.034589;

                        MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
                        [annotation setCoordinate:coordinate];
                        //AppDelegate *dataCenter = (AppDelegate *) [[UIApplication sharedApplication] delegate];
                        [annotation setTitle:value];
                        [self.mapView addAnnotation:annotation];
                        [self.mapView setRegion:newRegion animated:YES];

                    }
                }];
            }

}

  • 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-12T20:15:55+00:00Added an answer on June 12, 2026 at 8:15 pm

    This has nothing to do with blocks. Your blocks stuff looks fine. However, if you look at the documentation of the geocoding method you’re using, it says

    After initiating a forward-geocoding request, do not attempt to
    initiate another forward- or reverse-geocoding request.

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

Sidebar

Related Questions

This question may sound weird, but it's needed for injecting code to a binary.
I know the title may sound a little weird, but the same goes for
This may sound weird but ive been banging my head for the past 2
It may sound a bit weird, but in Bukkit (Minecraft Server) there's a permissions
The title may sound weird. Well, it is. Here's an approximation of my code
It may sound odd, but I've been programming games in PHP. The main problem
OK, this may sound weird, but here goes. There are 2 computers, A (Pentium
This may sound really stupid. but I've got a strange problem with the D
I know it may sound like a weird question, but is there any .NET
Ok, the title may sound a little weird, but I think that kinda describe

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.