1
votes

I have a navbar. The navbar has a button, which is linked to a View Controller. The Action for the button is "popover" to the view controller. I need the view controller to disappear when a button on the view controller is pressed. All i've got is [self.viewCV.superview.superview.superview.superview setHidden:true] (where viewCV is a direct child of the view controller) This seems to hide the view controller, however, some "controls" on the view controller where the "trigger button" (The UIBarButtonItem activating the second view controller) are removed.

1
Are you creating a UIPopover with your button action, or is your action name just named "popover". It's not clear what you are intending, and your use of the word popover is confusing - Justin
@JustinAmberson The button has an interface builder link to a UIViewController which is a "popover" link: i.imgur.com/Sfz25me.png - user2687781

1 Answers

0
votes

If you're just trying to dismiss a UIPopoverController, you don't have to dig around through superviews like that to try to hide it. All you need is to have a reference to the popover and you can simply tell it to dismiss itself:

[popoverController dismissPopoverAnimated:YES];