title: iOS - viewDidAppear: delayed when showing a UITableView
body: <p>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.</p>
  
  <p>When I touch a tab I want the tab to be loaded immediately with the view and after it has been loaded (<code>viewDidAppear:</code>) I want it to download some data in the viewDidAppear: method.</p>
  
  <p>To test this functionality I have setup the following method. I'm using a <code>NSThread</code> 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.</p>
  
  <p>I'm reloading the table because in the <code>viewDidLoad</code> 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.</p>
  
  <pre><code>- (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];
  }
  </code></pre>
  
  <p>So my expected behaviour should be that when touching this particular tab it should load <strong>instantly</strong> and then after 10 seconds it should be populated with table data from the viewDidAppear: method. <strong>But</strong> the behaviour is instead that when touching this tab it <strong>waits for 10 seconds</strong> and then it displays the view with the table data populated.</p>