替换segue创建新实例 [英] Replace segue creating new instance

查看:79
本文介绍了替换segue创建新实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了SplitViewController应用程序的问题。当我从主视图中的表中选择一行时,我正在用替换segue替换详细视图。问题是每次发生这种情况时都会创建一个新实例/重新加载详细视图控制器。我有什么方法可以拥有它,所以如果它已经被实例化,它将用前一个实例替换详细视图。我希望记住详细视图的状态,例如输入到文本字段中。

I've run into a problem with a SplitViewController app. When I select a row from the table in the master view I'm replacing the detail view with a replace segue. The problem is each time this happens it creates a new instance/reloads the detail view controller. Is there any way I can have it so it will replace the detail view with the previous instance if it has already been instantiated. I'd like the state for the detail views to be remembered, such as input into textfields.

推荐答案

无法完成。 segue将始终实例化视图控制器

Cannot be done. A segue will always instantiate a view controller

这篇关于替换segue创建新实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆