gpt4 book ai didi

iphone - 在 dismissModalViewControllerAnimated 之后调用 presentModalViewController 有问题

转载 作者:可可西里 更新时间:2023-11-01 05:42:39 25 4
gpt4 key购买 nike

我有密码

- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)match
{
[menuViewController dismissModalViewControllerAnimated:YES];
[GameKitWrapper getSingleton].match = match;
match.delegate = [GameKitWrapper getSingleton].remotePlayer;
[menuViewController presentModalViewController:avatarSelectionViewController
animated:YES];
}

但我有一个问题,解雇有效但现在无效。当我将 dismissModalViewControllerAnimated:YES 更改为 dismissModalViewControllerAnimated:NO 它有效但看起来不太好。

感谢任何帮助。

最佳答案

@adam 的想法是正确的,但您不想等待任意延迟。这很脆弱,因为完成动画可能需要任何时间。你想等待前一个 View Controller 真正完成关闭。根据我的经验,放置它的最佳位置是在当前 View Controller 的 viewDidAppear: 中。这将在您的模态完全消失后调用。参见 this question对于一些解决类似问题的示例代码。

关于iphone - 在 dismissModalViewControllerAnimated 之后调用 presentModalViewController 有问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5848023/

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