【发布时间】:2013-06-29 15:41:34
【问题描述】:
我有一个 iPad 应用,使用 XCode 4.6.3、iOS 6.2、ARC 和 Storyboards 创建。
我在 SubViewData.m 中以编程方式创建了一个 UIPopover。
@property (strong, nonatomic) UIPopoverController *popover;
// make rectangle to attach popover
CGRect rectangle = CGRectMake( touchPoint.x, touchPoint.y, 110, 1); // 0 height puts arrow on exact touch point
// get addressability to storyboard ViewController
UIViewController *popoverMainView = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"menuView"];
popover = [[UIPopoverController alloc] initWithContentViewController:popoverMainView];
[popover presentPopoverFromRect:rectangle inView:self
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
当点击弹出窗口中的 UIButton 时,我在另一个类 (QuickAppointment.m) 中设置通知。我收到通知并从 CalendarViewController.m 发出此代码:
SubViewData *svd = [[SubViewData alloc] init];
[svd.popover dismissPopoverAnimated:YES];
什么都没有发生!我不明白为什么不......所以,我做错了什么?
【问题讨论】: