导航栏上按钮弹出框

PopoverViewController *popoverCtrl = [[PopoverViewController alloc] init];
popoverCtrl.modalPresentationStyle = UIModalPresentationPopover;
popoverCtrl.preferredContentSize = CGSizeMake(200, 400);
popoverCtrl.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItem;
popoverCtrl.popoverPresentationController.backgroundColor = [UIColor grayColor];
popoverCtrl.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
popoverCtrl.popoverPresentationController.delegate = self;
[self presentViewController:popoverCtrl animated:YES completion:^{
}];
普通按钮弹出框

PopoverViewController *popoverCtrl = [[PopoverViewController alloc] init];
popoverCtrl.modalPresentationStyle = UIModalPresentationPopover;
popoverCtrl.preferredContentSize = CGSizeMake(200, 400);
popoverCtrl.popoverPresentationController.sourceView = self.choiceButton;
popoverCtrl.popoverPresentationController.sourceRect = self.choiceButton.bounds;
popoverCtrl.popoverPresentationController.backgroundColor = [UIColor grayColor];
popoverCtrl.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
popoverCtrl.popoverPresentationController.delegate = self;
[self presentViewController:popoverCtrl animated:YES completion:^{
}];