我已开始使用segue在viewcontrollers之间执行导航。这就是我从 EPSearchResultController 执行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];
}
任何人都知道为什么它会让我看到黑屏。
答案 0 :(得分:2)
1)在Storyboard中检查segue的演示风格。它可以是:
2)使用正确的解雇方法。
如果按,请使用[self.navigationController popViewControllerAnimated:YES]
如果是模态,[self dismissViewControllerAnimated:YES completion:];
答案 1 :(得分:0)
感谢您的支持......根据您的回答,我认为segue形成存在一些问题。我发现我从EPSearchResultController上的按钮到目标viewcontroller创建了segue。但它应该是从EPSearchResultController到目标viewcontroller。 : - )