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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:59:12+00:00 2026-06-13T05:59:12+00:00

Im trying to show the UIActivityIndicator on my NavigationBar in this MapView with the

  • 0

Im trying to show the UIActivityIndicator on my NavigationBar in this MapView with the following code. However, no matter which way I try I cannot show it. Whats the trick here? Also, I am trying to do the map annotations fetching from server and showing on the map in the background, is this the way to do it?

 - (void)viewDidLoad
 {
  [super viewDidLoad];

  self.activityIndicatorView = [[UIActivityIndicatorView alloc]                            
              initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
  self.activityIndicatorView.hidesWhenStopped = YES;
  self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
                                    initWithCustomView:self.activityIndicatorView];

 [self.activityIndicatorView startAnimating];
 [self performSelectorInBackground:@selector(loadMapAnnotations) withObject: nil];
 [self.activityIndicatorView stopAnimating];
 }

 //=========================================================================
 -(void)loadMapAnnotations
 {
   self.mapView.showsUserLocation = YES;
   if(self.vManager = [VendorManager getVendorManager])
   {
     NSLog(@"VendorManager = %@",[self.vManager description] );

     [self.vManager vendorsNearLocation:userLocation block:^(NSArray *vendors, 
      NSError *error)
      {
          if(vendors && [vendors count])
          {
             for (id v in vendors)
             {
                 Vendor *aVendor = [[Vendor alloc] initWithAttributes:v];
                 NSLog(@"Vendor from Vendors = %@",[aVendor name]);
                 [self.mapView addAnnotation:aVendor];
              }
         }
         else
         {
             NSLog(@"Failed to get vendors: %@", [error description] );
         }


      }];
     }
    }
  • 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-13T05:59:13+00:00Added an answer on June 13, 2026 at 5:59 am

    You’re hiding the activity indicator immediately after you show it.

    [self.activityIndicatorView startAnimating];
    [self performSelectorInBackground:@selector(loadMapAnnotations) withObject: nil];
    [self.activityIndicatorView stopAnimating];
    

    The problem is that you think that performSelectorInBackground:withObject: waits for the method to complete – I don’t really understand why you think it does, since it implicitly has its asynchronous behavior in its name…

    Nevertheless, moving the [self.activityIndicatorView stopAnimating]; call to the callback block will solve this “problem”.

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

Sidebar

Related Questions

i`m trying to show indeterminate progress bar in ABS v. 4.0.2 by following code
I'm trying to show a div AFTER all other animations have finished. The code
I am trying to show the 8 most recent scans added by doing this:
I'm trying to show a jquery dialog box with code like: var message =
Am trying to show UIKeyboard without using UITextView and UITextField . Am following the
I am trying to show the session value by drop down list. This is
I´m trying to show 16 decimal place of a result. The code I put
I'm trying to show custom UILabel in UITableViewCell, but something wrong. My code: -
iam trying to show image preview before upload, for that i am using code
I'm trying to show a 24 hours format using this line: Text='<%# Bind(Appointment, {HH:mm})

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.