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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:41:09+00:00 2026-05-17T22:41:09+00:00

I am trying to get a busy view displayed during a search process however

  • 0

I am trying to get a busy view displayed during a search process however it never seems to display.

What I am trying to achieve

  1. User clicks on search button once they have entered the text in a UISearchBar.
  2. The text entered is delegated to searchBarSearchButtonClicked.
  3. Show a “Busy view” which is a UIView containing a UIActivityIndicatorView to indicate the search is underway.
  4. Perform a search which communicates with a website.
  5. On search completion remove the “Busy View”.

Whats wrong

The search process is working fine, using the debugger I can see it moving through the searchBarSearchButtonClicked function fine however the “Busy View” never appears. The search takes 2-3 seconds so in theory I should see my “Busy View” appear for those 2-3 seconds.


Code Attempt 1 – Add and remove the “Busy View” from the superview**

- (void)searchBarSearchButtonClicked:(UISearchBar *)activeSearchBar {

 [activeSearchBar setShowsCancelButton:NO animated:YES];
 [activeSearchBar resignFirstResponder];
 [busyView activateSpinner]; //start the spinner spinning
 [self.view addSubview:busyView]; //show the BusyView

 Search *search = [[Search alloc]init];
 results = [search doSearch:activeSearchBar.text];

 [busyView deactivateSpinner]; //Stop the spinner spinning
 [busyView removeFromSuperview]; //remove the BusyView
 [search release]; search = nil;

}

Results Of Attempt 1 – It does not appear, however if I comment out the removeFromSuperview call the Busy View remains on screen.


Code Attempt 2 – using animations

- (void)searchBarSearchButtonClicked:(UISearchBar *)activeSearchBar {



[activeSearchBar setShowsCancelButton:NO animated:YES]; 
 [activeSearchBar resignFirstResponder];

 [UIView beginAnimations:nil context:nil];
 [UIView setAnimationDuration:0];
 [UIView setAnimationDelegate:self];
 [UIView setAnimationDidStopSelector:@selector(animationDidStop)];

 [busyView activateSpinner]; //start spinning the spinner
 [self.view addSubview:busyView]; //show the busy view

 [UIView commitAnimations];

 Search *search = [[Search alloc]init];
 results = [search doSearch:activeSearchBar.text];


 [UIView beginAnimations:nil context:nil];
 [UIView setAnimationDuration:0];
 [UIView setAnimationDelegate:self];
 [UIView setAnimationDidStopSelector:@selector(animationDidStop)];

 [busyView deactivateSpinner]; //sets stops the spinner spinning
 [busyView removeFromSuperview]; //remove the view

 [UIView commitAnimations];
 [search release]; search = nil;
}

Results of attempt 2 – Did not see the “Busy View” appear

  • 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-17T22:41:10+00:00Added an answer on May 17, 2026 at 10:41 pm

    Well, Here’s my solution:

    • Create singleton class MyLoadingView. This class should contain show and hide static methods.
    • In MyLoadingView constructor you should manually create a view with semi-transparent black background and activityview inside of it. Place this view into [[UIApplication sharedApplication] keyWindow]. Hide it.
    • [MyLoadingView show] invocation just brings myLoadingView object to front in it’s container: [[[UIApplication sharedApplication] keyWindow] bringSubviewToFront:myLoadingViewSharedInstance];. Also don’t forget to start activityview animation.
    • [MyLoadingView hide] stops activityview animation and hides sharedInstanceView.

    Please notice, that you need to invoke [MyLoadingView show] in a separate thread.

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

Sidebar

Related Questions

I am trying to impersonate a user to get anothers users calendar to display
So, I'm busy making a model viewer, I'm trying to get my dialog properly
Trying to get a wildcard search to pick up on any text in org_name
I have a small problem. I am busy trying to get messages from a
I have a gallery where the user rates the images. I'm busy trying to
I've been trying for about a day to get a table cell to display
So i am trying get 2 div-containers which both should contain centered text (Both
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes
I am trying get all html links within a string and replace them using
I am trying get all html links within a string and replace them using

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.