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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:40:40+00:00 2026-05-25T10:40:40+00:00

In example code below UIAlertView is show after delay, but i need display it

  • 0

In example code below UIAlertView is show after delay, but i need display it immediately

//metoda zapisuje komentrz na serwerze
-(void) saveAction {

    UIAlertView *progressAlert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"imageGalleries.sendAction", @"") message:@" " delegate:self cancelButtonTitle:NSLocalizedString(@"alert.cancel", @"") otherButtonTitles:nil];

    [progressAlert addSubview:progressView];
    [progressAlert show];

    // some long performance instructions
}

- (void)loadView {
    [super loadView];
    self.navigationItem.rightBarButtonItem =  [NavButton buttonWithTitle:NSLocalizedString(@"sendImage.saveButtonTitle", @"") target:self action:@selector(saveAction)];
    progressView = [[UIProgressView alloc] initWithFrame: CGRectMake(30.0f, 80.0f - 26, 225.0f, 10.0f)];
}

Why UIAlertView do not show immediately when I call saveAction?

  • 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-25T10:40:41+00:00Added an answer on May 25, 2026 at 10:40 am

    If the “long performance instructions” following the alert code run on the main thread, they will block the alert from appearing. Read something about Cocoa run loops, that should make things more clear. (Essentially it could be said that all the UI instructions in your method are not performed immediately – they have to wait for the method to end, and then the main run loop picks them up and runs them.)

    The code could better look like this:

    - (void) startSomeLongOperation {
       [self createAndDisplayProgressSpinner];
       dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_NORMAL, 0), ^{
           // …do something that takes long…
           dispatch_async(dispatch_get_main_queue(), ^{
                [self dismissProgressSpinner];
           });
       });
    }
    

    This moves the long operation into background, so that the main thread can continue executing immediately.

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

Sidebar

Related Questions

The example code below works as as a server process. But when I add
I have example of code below. <script type=text/javascript src=assets/scripts/somescript.php>. </script> So, will my browser
There is this example code, but then it starts talking about millisecond / nanosecond
I've gone through most of the example code and I still need some help.
(the example code below is self-contained and runnable, you can try it, it won't
In my example code below, is the counter = 0 really required, or is
So in the example code below, I create a UserControl UserControldChild which is a
Please look at the example code below, when I run it, the defined part
In the example code below, I get this error : Element TestSerializeDictionary123.Customer.CustomProperties vom Typ
Please review the example code below, I have a class file that is loaded

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.