title: UITableView not showing iPad running iOS 5
body: <p>I am running across a weird problem that came up out of now where. I'm not sure if it is because I have not updated to Xcode 4.2.1 or if it is iOS 5. </p>
  
  <p>I have an iPad application that runs on OS's 4.0 - 5.0. </p>
  
  <p>I have a UITableView that is contained in a view being shown modally as a form sheet. </p>
  
  <p>The table shows up fine running on 4.x but the table disappears when running on 5.0. </p>
  
  <p>I know everyone has heard this a million times but it literarily was working fine yesterday, I didn't change anything, now it doesn't work. I have a working copy from yesterday that is installed on an extra iPad running iOS 5. Today it doesn't want to work. </p>
  
  <p>Here is how I have it setup, maybe you can spot a problem. </p>
  
  <ol>
  <li><p>The UITableView is created in IB. The datasource and delegate ARE set. </p></li>
  <li><p>The view is being called like so:</p></li>
  </ol>
  
  <blockquote>
  <pre><code>GuidedSearchPriceViewController *guide = [[GuidedSearchPriceViewController alloc] initWithNibName:@"GuidedSearchPriceViewController_iPad" bundle:nil];
  UINavigationController *temp = [[UINavigationController alloc] initWithRootViewController:guide]; 
  temp.modalPresentationStyle = UIModalPresentationFormSheet; 
  [guide setModalDelegate:self]; 
  [guide setAppDelegate:self.appDelegate]; 
  temp.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; 
  [self presentModalViewController:temp animated:YES];
  </code></pre>
  </blockquote>
  
  <p>In <strong>iOS 4.x</strong> we get this:
  <img src="https://i.stack.imgur.com/l8r7S.png" alt="iOS 4.x"></p>
  
  <p>But is <strong>iOS 5</strong> we get this:
  <img src="https://i.stack.imgur.com/bphHU.png" alt="iOS 5"></p>
  
  <p>The viewDidLoad method of the Price view is:</p>
  
  <pre><code>- (void)viewDidLoad
  {
  
      [super viewDidLoad];
  
      //Tried for testing but still does nothing
      self.table.delegate = self;
      self.table.dataSource = self;
  
      UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Type" style:UIBarButtonItemStyleBordered target:self action:@selector(nextScreen)];
      addButton.enabled = NO;
      self.navigationItem.rightBarButtonItem = addButton;
  
      if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
          UIBarButtonItem *cancel = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dismiss)];
  
          self.navigationItem.leftBarButtonItem = cancel;
          self.navigationController.navigationBar.tintColor = [UIColor redColor];
          self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png", [[NSBundle mainBundle] bundlePath], RP_iPad_FormsheetBackground]]];
  
      } else
          self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.png", [[NSBundle mainBundle] bundlePath], RP_BackgroundImage]]];
  
      // Make sure the background of the table is clear. I have also tried taking this out
      // to resolve the disappearing issue but it has no effect. 
      if ([self.table respondsToSelector:@selector(backgroundView)]) {
          [self.table setBackgroundView:nil];
          [self.table setBackgroundView:[[UIView alloc] init]];
          [self.table setBackgroundColor:UIColor.clearColor]; 
      }
  
      priceList = [[NSArray alloc] initWithObjects:@"$750", @"$1000", @"$1250", @"$1500", @"$1750", @"$2000", @"$2000 +", nil];
  
  }
  </code></pre>
  
  <p>Thank you very much for any help, and as always thank you for your time. </p>
  
  <hr>
  
  <p><strong>ANSWER</strong></p>
  
  <p>I managed to figure out what the problem was but I am not sure why it is occurring. Maybe someone can shed some light on it. </p>
  
  <p>I had to insert </p>
  
  <p><code>[table reloadData];</code></p>
  
  <p>at the end of <code>-(void)viewDidLoad</code></p>
  
  <p>I'm not sure why it has to be there in iOS 5 but not in iOS 4.x</p>