ios - 无法使用 Storyboard执行 segue back

标签 ios objective-c ios7 segue

我已经开始使用 segue 来执行 View Controller 之间的导航。这就是我执行从 EPSearchResultController 到目标 viewcontroller 的 push segue 的方式。

   //.h file
@property (strong, nonatomic) EPSearchResultController *obj_EPFirstViewController;

    //.m File

    - (IBAction)submitEPSearchQuery:(id)sender {
    [self performSegueWithIdentifier:@"searchResultSegue" sender:sender];
}


    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"searchResultSegue"])
    {
        self.obj_EPFirstViewController = (EPSearchResultController*)[segue destinationViewController];
        self.obj_EPFirstViewController.searchAgainDelegate = self;
        NSDictionary* resultDict= [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"SearchResult" ofType:@"plist"]];
        self.obj_EPFirstViewController.searchResultArray = [resultDict objectForKey:@"Result"];
    }
}

问题:

当我从目的地返回到 EPSearchResultController 时,它显示黑屏。我正在使用

返回
#pragma mark - Search Again Delegate

-(void)moveBack{

    [self.navigationController popViewControllerAnimated:YES];
}

任何人都知道为什么它显示黑屏。

最佳答案

1) 检查 Storyboard 中 segue 的呈现样式。它可以是:

  • 推送
  • 模态
  • 自定义

2) 使用正确的 dismiss 方法。 如果 Push,使用 [self.navigationController popViewControllerAnimated:YES]
如果模态,[self dismissViewControllerAnimated:YES completion:];

关于ios - 无法使用 Storyboard执行 segue back,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22961275/

相关文章:

ios - Xcode 5 Assets 目录 : What is "Default" image set

iphone - 当 NSAttributedString + NSString 发送到 UIActivityViewController 并选择邮件应用程序时,iOS 7 应用程序崩溃

ios - MFMailComposeViewController 显示空 View

ios - 无论如何,有没有要从APNS注销的信息?

ios - 如何使用 UIView 创建自定义翻转动画

ios - 如何同时滑动标签文本和图像

ios - 错误地集成 native 图表显示

iphone - 我们应该手动释放 NSDate 吗?

objective-c - 菜单选项没有改变 - cocoa

ios - 将 CGPath 点转换为不同的 UIView 引用