I have a VC (the root VC of a navigation controller) with a container view. The container view embeds another VC. I believe this makes the latter a child VC of the former. I want to add a button to the navigation bar from the code for the child VC. I have tried using parentviewcontoller, but it doesn't work:
UIBarButtonItem *newConvoButton = [[UIBarButtonItem alloc] initWithTitle:@"New convo" style:UIBarButtonItemStyleBordered target:self action:@selector(newConvoInit:)];
self.parentViewController.navigationItem.rightBarButtonItem = newConvoButton;
And I know that code would work fine if it were in the parent VC and I removed the ".parentViewController".
So how can I add a navigation item from an embedded VC?
EDIT:
Here's a screenshot:
The TVC on the right logs (null) for self.parentViewController.