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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:25:33+00:00 2026-05-23T19:25:33+00:00

I want to get list from server it is taking some time So at

  • 0

I want to get list from server it is taking some time So at that time I’m displaying progress indicator. My problem sometimes the progress indicator is appearing and some times it is not appearing. The code I used is

-(void)viewWillAppear:(BOOL)animated

{
     [self loadprogressIndicator];  
}

-(void)loadprogressIndicator
{
     MessengerAppDelegate* appDelegate = (MessengerAppDelegate*) [ [UIApplication sharedApplication] delegate];
    [appDelegate showWaitingView];

    [NSThread detachNewThreadSelector:@selector(statusIndicatorForRefresh) toTarget:self withObject:nil];
}

-(void)statusIndicatorForRefresh
{   
    NSAutoreleasePool* pool=[[NSAutoreleasePool alloc]init];
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    [self performSelectorOnMainThread:@selector(loadList) withObject:nil waitUntilDone:NO];
    [NSThread exit];
    [pool release];
}

-(void)loadList
{   
    MessengerAppDelegate* appDelegate = (MessengerAppDelegate*) [ [UIApplication sharedApplication] delegate];
    customerList = [appDelegate getCustomersArray];
    [theTableView reloadData];
    [appDelegate removeWaitingView];
}

And in appdelegate.m I implemeted these two methods

- (void)showWaitingView 
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    CGRect frame = CGRectMake(90, 190, 32, 32);
    UIActivityIndicatorView* progressInd = [[UIActivityIndicatorView alloc] initWithFrame:frame];
    [progressInd startAnimating];
    progressInd.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
    frame = CGRectMake(130, 193, 140, 30);
    UILabel *waitingLable = [[UILabel alloc] initWithFrame:frame];
    waitingLable.text = @"Processing...";
    waitingLable.textColor = [UIColor whiteColor];
    waitingLable.font = [UIFont systemFontOfSize:20];
    waitingLable.backgroundColor = [UIColor clearColor];
    frame = [[UIScreen mainScreen] applicationFrame];
    UIView *theView = [[UIView alloc] initWithFrame:frame];
    theView.backgroundColor = [UIColor blackColor];
    theView.alpha = 0.7;
    theView.tag = 999;
    [theView addSubview:progressInd];
    [theView addSubview:waitingLable];
    [progressInd release];
    [waitingLable release];
    [window addSubview:[theView autorelease]];
    [window bringSubviewToFront:theView];
    [pool drain];
}

- (void)removeWaitingView 
{
    UIView *v = [window viewWithTag:999];
    if(v) [v removeFromSuperview];

}

Can anyone please help me. Happy Coding..

Thanks in advance.

Praveena..

  • 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-23T19:25:34+00:00Added an answer on May 23, 2026 at 7:25 pm

    You are doing all your activity on the main thread. Your app will appear to be blocked because you block the UI thread.

    Also what is the use of launching an NSThread if all it does is call a method on your main thread and not even wait for it to complete? You are doing no multithreading at all.

    Your app does this:

    in main thread:

    • show waiting view
    • do 1 run loop cycle
    • do your data processing
    • hide waiting view

    since your data processing is in the main thread you block everything there. You should do the processing in a secondary thread and leave the main thread for UI handling.

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

Sidebar

Related Questions

The problem is that I need to get static data from server prior the
I want to get a list of result sets and columns that i can
I want to get a list of all available datasets (that I'd creat in
I am trying to get the list from server through javascript using following var
i am fetching a list of photos from a server and displaying them. i'm
I want to get list of Domino Servers on the network, and accordingly login
i want to get list of all application or Threads attached with a process.For
I want to get a list of files in a directory, but I want
I want to get the list of removable disk in c#. I want to
I want to get the list of process names for the applications which are

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.