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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:28:49+00:00 2026-05-23T16:28:49+00:00

I’m having a weird problem. I have a Tab Bar application, in it I’m

  • 0

I’m having a weird problem. I have a Tab Bar application, in it I’m using a Navigation Controller for each of the different tabs and each Navigation Controller has it’s own View Controller to display some content.

When I touch a tab I want the tab to be loaded immediately with the view and after it has been loaded (viewDidAppear:) I want it to download some data in the viewDidAppear: method.

To test this functionality I have setup the following method. I’m using a NSThread to simulate doing some lengthy operation that should be done in the background while the view has been loaded. Then I assign the NSArray *test (nonatomic, retain) with some test data and reload the table.

I’m reloading the table because in the viewDidLoad method I’m setting the table to contain only one empty string (this is because I read that the table is setup before viewDidAppear: is called.

- (void)viewDidAppear:(BOOL)animated {

    [super viewDidAppear:animated];

    DLog(@"viewDidAppear running");

    [NSThread sleepForTimeInterval:10];

    NSArray *array = [[NSArray alloc] initWithObjects:@"Test1", @"Test2", @"Test3", @"Test4", @"Test5", @"Test6", nil];
    self.test = array;

    [array release];

    [table reloadData];
}

So my expected behaviour should be that when touching this particular tab it should load instantly and then after 10 seconds it should be populated with table data from the viewDidAppear: method. But the behaviour is instead that when touching this tab it waits for 10 seconds and then it displays the view with the table data populated.

  • 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-23T16:28:50+00:00Added an answer on May 23, 2026 at 4:28 pm

    Calling [NSThread sleepForTimeInterval:10]; will prevent the main thread from doing any updates so you cannot see any user interface changes. If you want to delay reloading of table data as above, check NSObject performSelector:withObject:afterDelay: NSObject Class Reference

    Put the code for reloadData and array setup in a method an call it via performSelector:withObject:afterDelay:

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't

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.