在我的 ios 应用程序中,假设我有三个ViewControllers: A、B和C.
从A我提出B并指定A为代表。完成一项操作后,我B想从. 但是,我想完全不显示在屏幕上。这是我现在的代码,在类内:BCAAA
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
B *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"B-identifier"];
vc.delegate = self;
[self presentViewController:vc animated:NO completion:^{}];
}
A然后这是执行操作时调用的内部委托函数B:
- (void) actionPerformed
{
[self dismissViewControllerAnimated:YES completion:^{
C *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"C"];
[self presentViewController:vc animated:NO completion:nil];
}];
然而,这会导致 C 出现一段时间(在调用解除之后),即使我将呈现代码放在解除的完成处理程序中。我能做些什么来避免这种情况?