ios - 从 Storyboard 中获取 viewController,而不是使用 instantiateViewControllerWithIdentifier

标签 ios storyboard viewcontroller

我想从 Storyboard中获取一个 View Controller ,这个 View Controller 已经存在,所以使用[MyStoryboard instantiateViewControllerWithIdentifier:@"identifier"];是绝对不正确的。任何建议都会有很大的帮助对我来说,非常感谢!

最佳答案

您可以通过其 viewControllers 属性访问标签栏 Controller 的所有内容 Controller ,并且您可以在应用委托(delegate)中使用 self.window.rootViewController 获取标签栏 Controller 。

关于ios - 从 Storyboard 中获取 viewController,而不是使用 instantiateViewControllerWithIdentifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24729480/

相关文章:

ios - 调整 UIImageView 的大小以包装 "aspect fitted"图像

ios - 在 Vimeo 上上传视频时出现问题(通过我的 iOS 应用程序)

ios - XCode5 中两个 UITableView 之间的奇怪纠缠

ios - 切换 View Controller

ios - 在 View Controller 中看不到 Storyboard 中的元素

ios - 带有完成处理程序的方法

ios - 使 UIButton 图像和文本都可点击

ios - 使用 Storyboard在 CollectionView 中仅显示两列,多行

button - Corona SDK - "ShowOverlay"与 LetterBox 问题

Swift:如何从 View Controller 访问 AppDelegate 变量?