Im using the following code to create a popover.

```
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([[segue identifier] isEqualToString:@"popover"]) {
        self.popoverTvc = [segue destinationViewController];
        self.popoverTvc.popoverPresentationController.delegate = self;
    }
}

```

When the user clicks a button in navigation bar, the above segue of popover style will be triggered and the resulting view controller has got tableview.

The problem is that,

In portrait mode, the size of table view is as per the size of the contents available. But when I change the view from landscape to portrait, the tableview contains empty cells that are visible and hence these empty cells are blocking the ui. Why is that so? I want the tableview not to block the entire screen even in landscape mode.

Im using the following code in view did load method to resize the tableview

```
if (self.tableView && self.presentingViewController) {
    self.preferredContentSize = [self.tableView sizeThatFits:self.presentingViewController.view.bounds.size];
}

```