dismissViewController
方法无法获得以前的viewcontoller
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
popViewController
工作并转到上一个视图控制器
[self.navigationController popViewControllerAnimated:YES];
我想传递如下数据,请帮助我。但正如我描述的dismissViewController
方法不起作用。
[self.navigationController dismissViewControllerAnimated:YES completion:^{
HomeVC *loading;
loading.IdNameLabel.text=display;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Code" message:display delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}];
预先感谢。
更新
-(void)viewWillAppear:(BOOL)animated{
self.IdNameLabel.text=self.GetscanResult;
}
此方法包含在 HomeVC 中。当关闭navcontroller
它时显示 HomeVC。
关闭视图控制器后可以调用上层方法吗?
解决方案
当我处于初学者水平时,这是一个非常愚蠢的问题。这是关于它的规范。这将取决于您将使用哪种方法Present
|| Push
视图控制器。
当视图控制器存在时,委托方法将与协议委托方法一起使用。