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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:01:14+00:00 2026-06-06T09:01:14+00:00

I am trying to show a activity indicatorvw when user taps on the cell

  • 0

I am trying to show a activity indicatorvw when user taps on the cell of the table view it should show and as soon as detail view loaded it should be hidden.

But it is showing after view loaded and then hides. so it is useless to show indicator while view loads

Inside viewdidload:

activityBgImageView = [[UIView alloc] initWithFrame:self.view.frame];
[activityBgImageView setBackgroundColor:[UIColor blackColor]];
[activityBgImageView setAlpha:0.7];
[activityBgImageView setCenter:self.view.center];
[activityBgImageView setHidden:YES];

activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[activityIndicatorView setCenter:CGPointMake(self.view.center.x+15, self.view.center.y-15)];
[activityIndicatorView setHidesWhenStopped:YES];
[activityBgImageView addSubview:activityIndicatorView];
[self.view addSubview:activityBgImageView];

Here is my code for table did select:

if([arrPostsData count]>0)
{
    [self startActivityIndicatorView];

    [self performSelector:@selector(showDetailVw) withObject:nil];

}

-(void)showDetailVw
{

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:.3];
detailVwBg.alpha = 0.0;
detailVwBg.alpha = 1.0;
btnBack.alpha = 1;

 [self showPostDetail:arrPostsData tapedCell:detailvwScrollCount     PostedFiles:arrUserPostedFilesDataDic comments:arrCommentsDataDic];

isDetailvwActive = TRUE;
[UIView commitAnimations];

}

and inside showPostDetail: method end i stop the indicator

Please suggest where I need to put correct code

these are indicator methods:

#pragma mark processindicator methods

-(void)startActivityIndicatorView{ 

[activityBgImageView setHidden:NO];
[activityIndicatorView startAnimating];
[self.view bringSubviewToFront:activityBgImageView];

if (![[UIApplication sharedApplication] isIgnoringInteractionEvents])
{
    [[UIApplication sharedApplication] beginIgnoringInteractionEvents];
}


}

-(void)stopActivityIndicatorView{


if ([[UIApplication sharedApplication] isIgnoringInteractionEvents])
{
    [[UIApplication sharedApplication] endIgnoringInteractionEvents];
}
[activityBgImageView setHidden:YES];
[activityIndicatorView stopAnimating];

}
  • 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-06T09:01:16+00:00Added an answer on June 6, 2026 at 9:01 am

    A little bit of background about threads & iOS. For all UI elements to change (visually) the programmer needs to make changes to them in the main thread.

    Since activityIndicatorView is a UI element, it has to run on main thread for it to display the spinning. If you are doing something else on your main thread then activityIndicatorView is blocked. Hence you are not seeing the spinning instantaneously. You will see it when the thread is freed up.

    If you want this to work then first start the spinner, then background thread, do processing in the bg thread, after it completes, come to main thread, stop spinner, and finally update the UI with the changes.

    Hope this helps…

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

Sidebar

Related Questions

I am trying to show an indicator view when loading data in viewDidLoad but
In the application,I am trying to a make activity show when user opens the
I am trying to show two custom listviews on one activity. But I am
I'm trying to show a list of data in an android activity. Normally anyone
OK, trying to get images from my SD card to show in an activity
I'm trying to test an Activity in android which will show a ProgressDialog and
I am trying to prepare my activity's how to use windows but I am
I'm trying to show a UIAlertView before actually deleting a cell from a UITableView
I'm trying to show a div when a user clicks in an input field,
HI, Im trying to show a ProgressDialog while the activity is loading. my problem

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.