Reputation: 1917
I have a UINavigationController which I add a subview to.
[masterNavigationController.view addSubview:footerViewController.view];
The problem is that the app crashes (SIGABRT in main.m) when a UIButton tries to send a message to the controller.
I know I could customize the navigationcontroller's toolbar, but it would make things very complex.
Is it possible to add subviews in an navigationcontroller like this, or is something else the problem?
-- edit ---
Here is the creation code of the footerviewcontroller:
CIFooterViewController*footerViewController = [[[CIFooterViewController alloc] init];
Upvotes: 1
Views: 847
Reputation: 1917
Seems like one cannot add a viewcontrollers view as subview. Making it a UIView instead and it works just fine.
Upvotes: 0
Reputation: 4718
I'm going to guess (as it's pretty common) that when you create footerViewController, you're not retaining it. Adding the view to the UINavigationController does nothing to keep that view controller around. Be sure you retain footerViewController.
Otherwise, you should post the code where you create it.
Upvotes: 1