I am trying to add a UITabBarController to a UIViewController:
[self.view addSubView:tabBarController.view];
I get a warning:
warning: 'UIView' may not respond to '-addSubView:'
How can I add a UITabBarController to my UIViewController?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The specific warning you are getting is because you are spelling the method name wrong; try
addSubview:instead ofaddSubView:.But, aside from that problem, you may still have difficulty getting the UITabBarController to work correctly in a subview, because it’s not intended to be used that way. The UITabBarController Class Reference says: