我在 iPad 的主端有一个 PatientTableViewController,它有一个用于添加新患者的按钮。它通过 popover segue 转换到这个 NewPatientViewController。
在 NewPatientViewController 中,我有一个 Done 按钮委托(delegate)回 PatientTableViewController:
- (void)newPatientViewController:(NewPatientViewController *)sender withZipCode:(NSNumber *)zipCode andFirstName:(NSString *)firstName andLastName:(NSString *)lastName
{
[self dismissViewControllerAnimated:YES completion:NULL];
[self dismissModalViewControllerAnimated:YES];
[sender dismissModalViewControllerAnimated:YES];
[sender dismissViewControllerAnimated:YES completion:NULL];
}
我在上面尝试过的方法均无效。但是,如果我使用 Modal segue,一切正常。哇?
最佳答案
在 this post 的帮助下终于弄明白了
基本上,您需要有一个变量来跟踪转场(您需要将其转换到 UIStoryboardPopoverSegue 中)和一些奇怪的事情。
我写了一个blog post更详细地描述解决方案。
关于objective-c - 如何关闭 iOS 5 中的弹出窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9253878/