0

I would like to have a navigation bar in my popover using storyboard.

When I try to accomplish it by referring the button to pop up to navigation controller (that refers to my pop up screen) in my storyboard:

enter image description here

Then, I try to assign the delegate to my pop up controller:

  CheckBoxListingViewController *rdvc = [segue destinationViewController];
  rdvc.delegate = self;

But it always returns null in pop up controller when I try to NSLog it.

I think the cause is because of I refer to navigation controller instead of directly refer to pop up controller since when I refer it directly, the delegate is not null anymore.

What can I do to accomplish these screens? Any suggestion? Many thanks!

Rendy
  • 5,572
  • 15
  • 52
  • 95

1 Answers1

1

destinationController is referring to your UINavigationController Try this:

CheckBoxListingViewController *foo = (CheckBoxListingViewController *)((UINavigationController *)segue.destinationViewController).topViewController;
Michael Kernahan
  • 1,442
  • 1
  • 13
  • 15
  • @Michael Kernahan : your answer just helped me solve my problem (accessing topViewController). You can write your answer to this question (http://stackoverflow.com/questions/13591559/how-to-pass-parameters-to-a-popover-view-controller-inside-a-navigation-controll) and I will validate it as the correct one. – HpTerm Nov 27 '12 at 21:04
  • Thanks - added comment to the guy who was almost there. :-) – Michael Kernahan Nov 28 '12 at 03:03