麻烦解雇iOS popover

时间:2013-01-31 23:52:50

标签: ipad uipopovercontroller

我在iPad上解雇popover时遇到了麻烦。

popover有3个按钮,其中两个工作正常,但是应该取消弹出窗口的取消不起作用。

我错过了什么?

@interface 
@property (nonatomic, strong) UIPopoverController *popoverDateSelector;
@end

@implementation ... 
@synthesize popoverDateSelector = _popoverDateSelector;

- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    if ([segue.identifier isEqualToString:@"iPadOpenDateSelector"]) {
        DateSelectorVC *dateVC = (DateSelectorVC *) segue.destinationViewController;      
        dateVC.dateSelectorDelegate = (id)self;

        self.popoverDateSelector = [[UIPopoverController alloc] initWithContentViewController:dateVC];
    }
}


// Popover has a cancel button which calls the following via a protocol.
// NOTE:  This code is being called - but is not dismissing the popover. 
- (void) dateSelectorVCButtonCancel:(id)dateSelectorController{
    [self.popoverDateSelector dismissPopoverAnimated:YES];
}

感谢您的帮助

0 个答案:

没有答案