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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:11:06+00:00 2026-06-15T22:11:06+00:00

I have the following code where i show a MBProgress view and then run

  • 0

I have the following code where i show a MBProgress view and then run code in a separate thread. I then get a handle to the main thread and dismiss the spinner which works and then i show a UIAlertView. The UIAlertView loads fine however i can not click any of the buttons. If the alert view is outside of the dispatch block it works fine. Any ideas?

[MBProgressHUD showHUDAddedTo:self.view animated:YES];
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{

    // Do something...
    GamePlayManager *gameManager = [GamePlayManager alloc];
    Session *sess = [Session sharedInstance];

    //Add the last actor to the end of the list
    NSMutableDictionary *connections = sess.connections;

    [connections setObject:sess.secondActor forKey:[NSString stringWithFormat:@"%d",kLastFieldtag]];

    BOOL result = [gameManager areAnswersCorrect:sess.connections startingActor:sess.firstActor endingActor:sess.secondActor];
    NSString *display = @"Sorry incorrect. Please recheck your answers.";

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Result"
                                                    message:display
                                                   delegate:self
                                          cancelButtonTitle:@"Cancel"
                                          otherButtonTitles:@"OK", nil];

    if (result)
    {
        display = @"You are correct! You Won!";

        if (sess.isMutiplayerGame)
        {
            [_gameCenterController endGame];

            [self showGameOverScreen:YES isMultiplayer:YES];
        } 
        else
        {                
            [self showGameOverScreen:YES isMultiplayer:NO];
        }

        dispatch_async(dispatch_get_main_queue(), ^{
            [MBProgressHUD hideHUDForView:self.view animated:YES];

            [alert show];
        });

    } 
    else 
    {
        dispatch_async(dispatch_get_main_queue(), ^{
            [MBProgressHUD hideHUDForView:self.view animated:YES];

            [alert show];
        });
    }
});
  • 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-15T22:11:08+00:00Added an answer on June 15, 2026 at 10:11 pm

    This is likely an issue caused by a clash between the MBProgressHUD‘s animation and the UIAlertView‘s animation.

    I’ve never used MBProgressHUD, but looking at the code on GitHub it seems they’ve already solved your problem. MBProgressHUD has a completionBlock property.

    Code like this should work: (Warning: Untested)

    dispatch_async(dispatch_get_main_queue(), ^{
        [MBProgressHUD HUDForView:self.view].completionBlock = ^{
            [alert show];
        };
        [MBProgressHUD hideHUDForView:self.view animated:YES];
    });
    

    MBProgressHUD fires its completionBlock after the view has finished its animation, so there should no longer be a conflict.

    As a side note the MBProgressHUD method:

    - (void)showAnimated:(BOOL)animated 
     whileExecutingBlock:(dispatch_block_t)block 
                 onQueue:(dispatch_queue_t)queue
         completionBlock:(MBProgressHUDCompletionBlock)completion;
    

    seems like it would be a better fit for your code.

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

Sidebar

Related Questions

I have the following code to show a progress ajax icon and then run
Hi people I have the following JavaScript code in my Show All Games View:
i have following code to show div on page <div id=all_users> <div id=user11 userid=11
I have the following code to show me a custom list with images and
I have the following code: function show(){ var a=document.getElementById('somediv').style.display; a=block; } The above code
I have the following code: builder = gtk.Builder() builder.add_from_file(glade_file) builder.get_object(windowMain).show() socket = gtk.Socket() socket.add_id(long(OpenGLWindowID))
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>
I have the following code to show a toast notification locally in a C#
I have got the following code to show a dialog box when the image
I am fairly new to jQuery and have written the following code to show

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.