ios - 如何在 Storyboard上获取事件的 UIViewController?

标签 ios ipad storyboard

有人可以告诉我如何获取之前创建的 UIView Controller 吗?,我正在使用 Storyboard,并且我已阅读有关方法 instantiateViewControllerWithIdentifier 的苹果文档:但是该文档说每次我调用此方法时它都会创建一个新实例ViewController 的名称,我想要的是使用现有的。

我正在 Storyboard上寻找 UIViewController 单例。可能吗?

提前致谢!!

最佳答案

如果您只调用 instantiateViewControllerWithIdentifier: 一次,然后将结果保存为强属性以供重复使用,那么您将只创建一次。

关于ios - 如何在 Storyboard上获取事件的 UIViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11992685/

相关文章:

ios - 为 UIScrollView 正确定义高度

ios - 按钮在 UIDocumentPickerViewController 中不可见

ios - 表格单元格圆角边框

objective-c - iOS UIImageView 缩小图像在 iPad 2 上产生锯齿图像

iphone - 为 iOS Developer Enterprise Program 中的其他公司构建的临时测试

html - 尝试从 html 中提取表数据

ios - 如何在生产中为实时 iOS 应用程序添加额外权限?

ios - Firebase 配置快速崩溃

ios - 如何在 Storyboard 中加载没有按钮的 View Controller ?

ios - 如何滚动到 UITableViewCell 的底部而不是 TextField