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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:09:14+00:00 2026-05-19T04:09:14+00:00

In my UITableViewController subclass I want to prepare the tabular data and reload the

  • 0

In my UITableViewController subclass I want to prepare the tabular data and reload the table after the view has already appeared (the table therefore initially loads empty). In my app delegate I have methods to produce and remove an activity screen. My problem seems to be that the activity view presentation is being delayed until after the reloadData call has been made. I proved this by removing the hideActivity line and sure enough my activity view appeared simultaneously with the reloading of the table. Here’s the viewDidAppear for my view controller…

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [(AppDelegate *)[[UIApplication sharedApplication] delegate] showActivity];
    [self prepare];
    [self.tableView reloadData];
    [(AppDelegate *)[[UIApplication sharedApplication] delegate] hideActivity];
}

I’m assuming this may have to do with the views not redrawing mid-method, but don’t remember this happening before. Any ideas?

…although I know they work, here’s my activity methods. Maybe the way I’m doing these allows for some sort of delayed appearance…

- (void)showActivity
{
    self.activityView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
    self.activityView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.75f];

    UIActivityIndicatorView *spinner = [[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake((320.0f / 2.0f) - (37.0f / 2.0f), (480.0f / 2.0f) - (37.0f / 2.0f) - (20.0f / 2.0f), 37.0f, 37.0f)] autorelease];
    spinner.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
    [spinner startAnimating];   

    UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(0.0f, spinner.frame.origin.y + spinner.frame.size.height + 10.0f, 320.0f, 30.0f)] autorelease];
    label.textAlignment = UITextAlignmentCenter;
    label.text = @"Working";
    label.textColor = [UIColor whiteColor];
    label.backgroundColor = [UIColor clearColor];

    [self.activityView addSubview:label];
    [self.activityView addSubview:spinner];

    [self.window addSubview:self.activityView];
}

- (void)hideActivity
{
    [self.activityView removeFromSuperview];
    [self.activityView release];
}
  • 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-19T04:09:14+00:00Added an answer on May 19, 2026 at 4:09 am

    Your UI isn’t updating until you return control to the runloop. You need to either perform the preparation of the data in a background thread, or return control to the runloop to update the UI before starting the preparation, like this:

    - (void)viewDidAppear:(BOOL)animated {
      [super viewDidAppear:animated];
      [(AppDelegate *)[[UIApplication sharedApplication] delegate] showActivity];
      [self performSelector:@selector(prepareData) withObject:nil afterDelay:0.0];
    }
    
    - (void)prepareData {
      [self prepare];
      [self.tableView reloadData];
      [(AppDelegate *)[[UIApplication sharedApplication] delegate] hideActivity];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application one is mainviewcontroller which is subclass of uiTableviewcontroller holds data from
I have a UIPickerView as subview in a UITableViewController, which I want to slide
I have a UITableViewController subclass that's instantiated, depending on where it's used, in a
I have a UITableViewController subclass that renders a list of pre-set categories and fetches
I have a subclass of UITableViewController. I have code that can add/remove a UISearchBar
I have a subclass of UITableViewController that works as expected. I'd like to capture
If you want to modify the default behaviour of a View Controller by changing
I have a view based app that works well. (In other words, I'm not
I have a basic question that's driving me crazy. I have a class inheriting
I'm working on my first iPhone app and have been able to get most

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.