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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:53:52+00:00 2026-05-24T01:53:52+00:00

I have a UIAlertView that asks a user whether they want to copy a

  • 0

I have a UIAlertView that asks a user whether they want to copy a bunch of contacts. After the user clicks “Continue,” I want the AlertView to disappear to be replaced by a UIProgressView that shows the rate of loading.

Everything functions properly except that the alert remains on the XIB after the user clicks Continue, and it doesn’t disappear until the entire process has run. As soon as it disappears, the UIProgressView bar appears but by then it has reached 100%.

How do I clear the UIAlertView off the screen immediately and show the progress bar growing instead.

Here’s the code. Thanks for help.

-(IBAction)importAllAddressBook:(id)sender {

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Import ALL Contacts" message:@"Do you want to import all your Address Book contacts?  (Please note that only those with a first and last name will be transfered)" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Continue", nil];
    [alert show];
    [alert release];


}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

    if (buttonIndex == 0) {
        NSLog(@"NO STOP");
        return;
    }else {
        NSLog(@"YES CONTINUE");
        importAllContactsProgress.hidden = NO;  // show progress bar at 0
        [self importAllMethod];           
        }
}

// method to import all Address Book
-(void) importAllMethod {


    importAllContactsProgress.progress = 0.0;

   load names etc etc 
  • 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-24T01:53:53+00:00Added an answer on May 24, 2026 at 1:53 am

    You’ll want to perform the perform the import on a background thread:

    [self performSelectorInBackground:@selector(importAllMethod)];
    

    Your import method is blocking the main thread and preventing any UI actions from occurring.

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

Sidebar

Related Questions

I have a UISegmentControl that select nothing through IB, after the user selects the
I want to have a UIScrollView that is inside of my UIAlertView . Code
Essentially I have a UIAlertView that pops up. When a user selects a button
I have a method that posts HTTP data and displays a UIAlertView if there
I have made a custom UINavigationController class so that I can have a UIAlertView
this is the code i have taken form..... - (void)willPresentAlertView:(UIAlertView *)alertView { [[[alertView subviews]
I have a UIAlertView with the following delegate method: - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex {
I have an UIAlert UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@ok message:@Canc? delegate:self cancelButtonTitle:@OK otherButtonTitles:@Annul,
I have controller which implements UIAlertViewDelegate. In implementation I have: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
I have several UIAlertViews that i want to display in a sequential order, 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.