mattgemmell/MGSplitViewController — Issue #48: setMasterViewController and setDetailViewController do not remove old viewControllers's view
Author: felixLam
Created: 2011-11-07 17:57:55+00:00
State: open

When using the methods setMasterViewController or setDetailViewController the view of the replaced viewcontroller is not removed from the view hierarchy. This leads to crashes as its viewController gets released and cannot received remaining delegate calls (e.g. UITableViewDataSource methods).

The setViewControllers methods correctly removes the old viewControllers' views before setting new ones.

calling

```
[[[self.splitViewController detailViewController] view] removeFromSuperview];
```
before setting the new detailViewController fixes this issue. I will do my best to submit a patch.