在我的 Storyboard中,我有一个 TextInputViewController
(UIViewController
的子类)。我有多个推送 segues 导致 TextInputViewController 具有来自各种 View Controller 的不同标识符。然而,每次调用这些 segues 之一时,它们似乎都会转到 TextInputViewController
的同一个实例,这会导致非常奇怪的行为。
有没有办法让每个 segue 创建一个不同的 TextInputViewController
实例?
最佳答案
Segues 总是创建 destinationViewController 的新实例(unwind segue 除外,它只是返回到先前创建的 viewController)。
您看到的行为一定是由 viewController 外部的某些其他状态引起的,因为它是一个新实例。
关于ios - 多个 segues 到一个 UIViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35827552/