title: On an iOS single view app, when is the earliest time that self.view.bounds is set correctly?
body: <p>I am trying to add a <code>UITableView</code> object that covers up the whole screen, by</p>
  
  <pre><code>  UITableView *tabelView = [[UITableView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:tabelView];
  </code></pre>
  
  <p>but I realized that even if a physical iPad 2 is rotated to Landscape mode, <code>self.view.bounds</code> is <code>{{0, 0}, {768, 1004}}</code> in <code>viewDidLoad</code> and <code>viewWillAppear</code>.  Only in <code>viewDidAppear</code> is it finally <code>{{0, 0}, {1024, 748}}</code></p>
  
  <p>What is the earliest time that <code>self.view.bounds</code> is set correctly to <code>{{0, 0}, {1024, 748}}</code>?  If <code>viewDidAppear</code> is the one, then I have to create the <code>UITableView</code> there, and if the "Launch image" is a static Landscape blank table, then the screen will flash a white screen when <code>viewDidAppear</code> is called, and then the table is added and seen, so a flash of white screen is seen.</p>
  
  <p>So when is the earliest time that <code>self.view.bounds</code> is set correctly to <code>{{0, 0}, {1024, 748}}</code>?  It seems like it needs to be slightly before <code>viewDidAppear</code>, so that the blank table is drawn (with the grey lines), and show it and seamlessly get displayed to cover up the Launch image.  If the table is created in <code>viewDidLoad</code> or <code>viewWillAppear</code> using <code>self.view.bounds</code>, then the table ends up being 768 points wide and is meant for the Portrait mode.</p>
  
  <p><strong>Update: I just tried to add the Launch image and for some reason, even if the <code>UITableView</code> is added in <code>viewDidAppear</code>, the "flash of white screen" didn't happen... I don't know why, but previously if I use <code>CALayer</code> and bitmap to show content, and didn't use any view or <code>drawRect</code>, then the flash occurred...  by the way, the earliest one I found was <code>viewWillLayoutSubviews</code>, and then later in <code>viewDidLayoutSubviews</code>, both of which happened before <code>viewDidAppear</code>, and both showed <code>self.view.bounds</code> as <code>{{0, 0}, {1024, 748}}</code></strong></p>
  
  <p><strong>Update 2: What if the view is complicated and time consuming to make?  To test, I added a <code>usleep(100000);</code> in the <code>tableView:cellForRowAtIndexPath</code> to sleep 0.1 second for each cell, and the "flash" did occur... but cell and table supposedly should be light weight and fast to make, but what if there are other type of views that are more time consuming to make?  If I move <code>UITableView</code> creation to <code>viewWillLayoutSubviews</code>, then it is still slow to show something, but at least there is no "flash".  However, later on when I rotate the device, it actually call <code>viewWillLayoutSubviews</code> again and add another table to the main view (with correct screen size), so <code>viewWillLayoutSubviews</code> will need to remove any old table view first, if any, or just resize the old one and not add a new one.</strong></p>