The problem is that the tabBarController
is not retained (and that is why the target in the exception is a UIPeripheralHost
[garbage]).
So in order to keep the controller alive you will have to hold a strong reference to it via a strong property or add it as a child controller (via addChildViewController:
)