Segue Popover won't behave properly
- by CStreel
I'm trying to use Segue to present then dismiss a Popover view a UIBarButtonItem is clicked.
I've created a generic Segue that is not anchored to anything but the view and given it a name
I've Anchored the UIBarButtonItem in the Interface Builder to:
- (IBAction)clickedSettings:(id)sender {
if(self.popSegue != nil) {
[self.popSegue.popoverController dismissPopoverAnimated:YES];
} else {
//Current says only a button may
[self performSegueWithIdentifier:@"Settings" sender:sender];
}
}
But when ever i click the button to display the Segue it gives me an error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIStoryboardPopoverSegue must be presented from a bar button item or a view.'
It doesn't even hit my -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
I've read the following questions on stack:
iOS:How to dismiss Popover
UIBarButtonItem + popover segue creates multiple popovers
But i still get the same error. For the life of me i can't figure out what is going wrong