You can either do it in code by detecting the iPhone type like #2, or if you use layout constraints, you can add a single constraint in code that relates the height of the table view to the height of the screen. The table view height can be expressed as the screen height times a multiplier plus a constant, so if you solve for these two equations, you'll get values for the multiplier and constant that will work:
568 * multiplier + constant = 363 and 480 * multiplier + constant = 297
If you work this out, it gives you multiplier = .75 and constant = -63.0115
So the code I use looks like this. I add a fudge factor of 10 to the constant I calculated to take care of padding in the table view (I determined this empirically). I created a height constraint in IB, and made an IBOutlet to it -- it doesn't matter what its value is, since I immediately remove it in viewDidLoad (it's needed in IB so the constraints will be sufficient).
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.dataSource = self;
self.tableView.delegate = self;
self.theData = @[@"One",@"Two",@"Three",@"Four",@"Five",@"Six",@"Seven",@"Eight",@"Nine",@"Ten",@"Eleven",@"Twelve"];
[self.tableView reloadData];
[self.tableView removeConstraint:self.tableHeight];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.tableView attribute:NSLayoutAttributeHeight relatedBy:0 toItem:self.view attribute:NSLayoutAttributeHeight multiplier:0.75 constant:-63.0115 + 10]];
}