0

我有两个视图控制器,它们都调用了弹出框,我如何检测哪个视图调用了弹出框。

谢谢

我通过以下方法调用弹出框

    EditPupilSelectController = [[EditPupilSelect alloc] initWithNibName:@"EditPupilSelect" bundle:nil];
    [EditPupilSelectController setDelegate:(id)self];
    EditPupilSelectPopoverController = [[UIPopoverController alloc] initWithContentViewController:EditPupilSelectController];

    EditPupilSelectPopoverController.popoverContentSize = CGSizeMake(700, 1000);

    if ([EditPupilSelectPopoverController isPopoverVisible]) {
        [EditPupilSelectPopoverController dismissPopoverAnimated:YES];
    } else {
        CGRect popRect = CGRectMake((0),    (0),    (1),    (1));
        [EditPupilSelectPopoverController presentPopoverFromRect:popRect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    }
4

0 回答 0