To create from code a parent/child relationship between 2 view controllers basically it's just matter of doing something like:

[self addChildViewController:childViewController];
[self.view addSubview:childViewController.view];

where self is the parent view controller.
But, what if I want to create the same relationship completely from Interface Builder?
Or in other words: is there a way to re-create the behavior of the method addChildViewController using Interface Builder?
I didn't find a lot of documentation about that, here is an old unresolved post about the topic: https://devforums.apple.com/message/455758#455758

Without properly setting up the addChildViewController relationship, none of the rotation methods are forwarded to my child view controller, here where my question come from.

This is what I've done in IB:

  1. drag and dropped a "View Controller" object from the "Object Library" panel into the "Objects" panel
  2. in the identity inspector I've changed its class to my UIViewController subclass ("Items View Controller")
  3. connected the view outlet to the controller
  4. connected all the other required outlets to the controller (List name, Table View)

The first "View" object in the picture is the view of my parent view controller, instead the highlighted "View" is the view of the child view controller ("Item View Controller").

enter image description here

The container controller also retain its child instance through an additional IBOutlet:

@property (nonatomic, strong) IBOutlet ItemsViewController *itemsViewController;

Thanks


Update 1: If I manually set the parent/child relationship in viewDidLoad

Edit
Report