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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:05:36+00:00 2026-05-28T17:05:36+00:00

I am having a small issue with MBProgressHUD in my app. Basically I am

  • 0

I am having a small issue with MBProgressHUD in my app.

Basically I am using it in the simplest way I can find to do it:

[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[self performSelector:@selector(save) withObject:nil afterDelay:0.001];
[self refreshView];

The method refreshView has this line at the end of it’s execution:

[MBProgressHUD hideHUDForView:self.view animated:YES];

The MBProgress shows up exactly how it should, but for the last half(ish) of it’s duration fades to a barely visible state, making it appear as though the methods have finished executing before they actually finish.

Any ideas on what might be going wrong here?

Thanks a lot!

  • 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-28T17:05:37+00:00Added an answer on May 28, 2026 at 5:05 pm

    The concept you need to understand is that of the run loop. The run loop is the internal loop in your program that handles incoming events, timers, networking, etc. (It is provided and run by the system so you don’t actually see this loop in your code.)

    With this line:

    [self performSelector:@selector(save) withObject:nil afterDelay:0.001];
    

    you schedule the -save action to run after 1 ms. (or later, if the main thread is busy doing something else)

    After scheduling this -save (so not after running it) you call your refreshView which hides the HUD.

    So what actually happens is that you show and hide the HUD in one go. So you see something like the combined animation of showing and hiding it. Independently, your -save method is called.

    Contrary to what UIAdam suggests, you do need the performSelector:afterDelay: because you need to give the run loop some time to breathe and display your eye candy on the screen. Changes to the user interface do not happen immediately, but only as the program returns to the run loop.

    The fix is therefore to take this line:

    [self refreshView];
    

    and move it to the end of your -save method.

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

Sidebar

Related Questions

Having a small issue and wondering if I'm using these correctly. In my SQL
I am having a small issue using the classic WebLogin snippet (Not WebLoginPE) in
I'm using CodeIgniter, and I'm having a small issue with sessions. I've set 'sess_expiration'
I'm on Rails 3 using jQuery. I'm having a small issue with an application
We're having a small issue and could use some help - we have the
I'm having an small issue with SQLXML in SQL Server 2008. Here's my testing
I'm having a small issue here: <div id=navbar> <ul id=navtabs class=floatcontainer> <li <?php if
I'm new to LINQ and am having a small issue. I created a DBML
Using Apache POI to generate a document and i'm having a small problem with
I've having a small issue loading a ~50meg file into a database. Unfortunately, and

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.