As others have pointed out in the comments, and as indicated by the console message you get, your primary problem is that you never initialize webViewController
. Add a line that looks something like this to your table view controller's initWithStyle:
initializer.
self.webViewController = [[WebViewController alloc] init];
Other things that I spotted:
In
viewDidLoad
you alloc/init a newUITableView
. You should not do this because you are overwriting theUITableView
instance that was already created by theUITableViewController
base class inloadView
. Check out my other answer for more info about the lifecycle of views and view controllers.In the parent view controller you forgot to invoke
didMoveToParentViewController
. You need to do this after you calladdChildViewController
. Read the section "Implementing a Container View Controller" in the UIViewController class reference for details.