Rotation reloading tableview


When using a form sheet style popover for the detail view, there is (IMO) an undesirable effect when rotating the device. When adding a new object from the items view, the popover appears, however, the item doesn’t show up in the tableview until the user presses “Done”. If the user cancels, the item is removed from the store before the tableview is reloaded and thus never appears. However, while the form sheet style popover detail view is shown, if the user rotates the device, the underlying tableview is forced to reload and thus picks up the new item. If the user cancels, the item disappear as you would expect. Not a big issue, but it is an inconsistent user experience. Does anyone know a clean way to suppress the reloading of the tableview while the popover is visible? One way I can think of is to trick the reload into not showing the new item in

  • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

If the popover is visible (via the isPopoverVisible property), then return the number of rows to be 1 less than the BNRItemStore count. isPopoverVisible is a property of UIPopoverController, not UINavigationController. How can numberOfRowsInSection: be made aware of the isPopoverVisible property?



Another way to approach this is not to suppress the premature appearance of the new line, but to force it. In addNewItem: of ItemsViewController.m, change


This way, the line appears as soon as the popup finishes presenting, and turning the ipad doesn’t result in any unexpected changes. No good if you steadfastly don’t want the thing to show up until confirmed by the user, but otherwise a nice solution, I think.