This has been driving me mad for a few days…
- Create a new Window-based application for iPad.
- Create a new UITableViewController class, targeted for iPad, with XIB.
- Add the UITableViewController view as a subview to the AppDelegate window.
- Set the table style to Grouped in the nib.
- Run in iPad simulator and the table cells go off right-hand end of screen
If I allow rotation and reload the tableView then it’s subsequently sized correctly. Run on iPhone sim displays fine, just iPad portrait initial view that is mis-sized.
I had a similar problem with a UITableView in a sub-view on my window. I solved it by setting the size of the frame of my UINavigationController in viewDidLoad. For some reason the subview was not constraining itself to the size of the view specified in Interface Builder. Here is what worked for me: