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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:23:13+00:00 2026-06-07T22:23:13+00:00

I’m trying to display a UIAlertView with UIActivityIndicator after a user presses log in

  • 0

I’m trying to display a UIAlertView with UIActivityIndicator after a user presses “log in” in a modal view controller. To log in, the credentials are sent to a server using sendAsynchronousRequest:queue:completionHandler: from the NSURLConnection class. My implementation is as follows:

UIAlertView * spinner = [[UIAlertView alloc] initWithTitle:@"Connecting to server..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
[spinner show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
indicator.center = CGPointMake(spinner.bounds.size.width * 0.5f, spinner.bounds.size.height * 0.5f+5.0f);
[indicator startAnimating];
[spinner addSubview:indicator];
[indicator release];

[NSURLConnection sendAsynchronousRequest:req queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * res, NSData * data, NSError * err) {
    [spinner dismissWithClickedButtonIndex:0 animated:YES];
    [spinner release];
    ...
}

This seems to work fine if the server can’t be reached or the server is slow, but if the server replies immediatly, the spinner doesn’t seem to be dismissed until after 3-5 seconds with the console logging

wait_fences: failed to receive reply: 10004003

I think this happens because I’m dismissing a modal view controller (the log in screen) while the UIAlertView is still showing but I’m not sure why this happens as it should normally be dismissed. Am I doing something wrong and what would be the correct way of doing this?

  • 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-07T22:23:14+00:00Added an answer on June 7, 2026 at 10:23 pm

    I have seen this log several times – it is always caused by an unexpected state in the internal animation framework or a collision between default view animations.

    Possible reasons:

    1. Starting animations from inside viewDidLoad, viewWillAppear or similar method – before the view is actually displayed.
    2. Showing/Hiding a UIAlertView when another UIAlertView animation is still running. This includes showing an alert from alertView:didDismissWithButtonIndex:.
    3. Collision between modal view animation and alert animation.
    4. Collision between UINavigationController push/pop animation and alert animation.

    Your case: You are probably hiding your alert even before it has been fully displayed and you get a collision between the two animations. The showing animation takes usually about 0.4 seconds but your response can arrive much earlier – triggering the hiding animation.

    Possible solution:

    1. Trigger request when your animation ends (didPresentAlertView).
    2. Measure the duration of your connection and if it`s shorter than 0.4 secs, delay the hiding animation.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but

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.