gpt4 book ai didi

ios - 多个 segues 到一个 UIViewController

转载 作者:行者123 更新时间:2023-11-28 06:47:47 24 4
gpt4 key购买 nike

在我的 Storyboard中,我有一个 TextInputViewController(UIViewController 的子类)。我有多个推送 segues 导致 TextInputViewController 具有来自各种 View Controller 的不同标识符。然而,每次调用这些 segues 之一时,它们似乎都会转到 TextInputViewController 的同一个实例,这会导致非常奇怪的行为。有没有办法让每个 segue 创建一个不同的 TextInputViewController 实例?

最佳答案

Segues 总是创建 destinationViewController 的新实例(unwind segue 除外,它只是返回到先前创建的 viewController)。

您看到的行为一定是由 viewController 外部的某些其他状态引起的,因为它是一个新实例。

You can read more about using Segues here.

关于ios - 多个 segues 到一个 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35827552/

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