I have an iPad app with splitview and a right bar button in the navigation bar of the detailviewcontroller.
This button calls a popover constituted of a navigation c
I'm not entirely sure I follow, because the storyboard is a bit small for me to read. But you seem in your code to have created a sparkling new popoverFirstTVC and then thrown it away by the assignment
popoverFirstTVC = segue.destinationViewController;
If you comment that line out, then at then end write
segue.destinationViewController.itsPopover = popoverFirstTVC;
then you can pass off your fully-constructed and initialised popoverFirstTVC and have code in the second VC pick it up and run with it. Of course, you need
@property (strong, readwrite) MyPopoverFirstTableViewController * itsPopover;
in the header for your second VC.
All the credit belongs to @Michael Kernahan, but as long as he don't post it as an answer I'll write it as a follow up for people looking for the same answer.
In my case the problem was that I am assigning the destination controller which is the navigation controller
popoverFirstTVC = segue.destinationViewController;
what I should do is to access the topViewController of that navigation controller.
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([[segue identifier] isEqualToString:@"popoverButtonSegue"]){
MyPopoverFirstTableViewController *popoverFirstTVC = (MyPopoverFirstTableViewController *)((UINavigationController *) segue.destinationViewController).topViewController;
popoverFirstTVC.property1 = aProperty1;
popoverFirstTVC.property2 = aProperty2;
}