gpt4 book ai didi

ios - 为什么在我的 View 被推送到导航堆栈之前我的 UIAlertView 没有在屏幕上消失?

转载 作者:行者123 更新时间:2023-12-01 19:10:24 24 4
gpt4 key购买 nike

这是按调用顺序排列的代码。一个 UIAlertView当这段代码被调用时,屏幕上会出现:

[upcAlertView dismissWithClickedButtonIndex:0 animated:YES];

[self.navigationController pushViewController:editController animated:YES];

问题是 UIAlertVieweditController 之前不会从屏幕上移除出现。我需要这些事情发生,因为我在 viewWillAppear 中进行了一些加载。的 editController所以我想添加一个快速进度轮(但我需要对话框消失)。这段代码是从主线程调用的。

任何人有任何见解?

最佳答案

查看 UIAlertViewDelegate文档,更重要的是方法

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;

调用此方法时,您可以推送 View Controller ,以便您知道它在推送之前已被解除。

像这样:
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
[self.navigationController pushViewController:editController animated:YES];
}

关于ios - 为什么在我的 View 被推送到导航堆栈之前我的 UIAlertView 没有在屏幕上消失?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16947155/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com