如何解决iOS 5中的popovers?

Fla*_*viu 4 xcode cocoa-touch objective-c ipad xcode4.2

我在iPad的主控侧有一个PatientTableViewController,它有一个用于添加新病人的按钮.它通过popover segue转换到这个NewPatientViewController.

NewPatientViewController中,我有一个Done按钮,该按钮委托给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];
}
Run Code Online (Sandbox Code Playgroud)

我上面尝试过的方法都没有.但是,如果我使用Modal segue,一切正常.笏?

Fla*_*viu 5

最后在这篇文章的帮助下弄明白了

基本上,你需要有一个变量跟踪segue(你需要将其转换为UIStoryboardPopoverSegue)并且更加奇怪.

我写了一篇博文,更详细地描述了解决方案.