【问题标题】:iOS6: How to connect UIViewController in Storyboard via Identifier?iOS6:如何通过 Identifier 连接 Storyboard 中的 UIViewController?
【发布时间】:2012-09-12 07:40:44
【问题描述】:

有谁知道如何将 Storyboard 中的 UIViewControllers 与标识符连接起来?它似乎不再起作用了..

【问题讨论】:

  • 也许你的意思是 UIViewController?

标签: iphone ios xcode storyboard ios6


【解决方案1】:

选择 UIViewController,一旦你看到一个突出显示的 UIView(通常是蓝色)然后转到 XCODE 上最左边的列。选择属性检查器,您将在“视图控制器”部分看到“标题”和“标识符”标签。给它起任何名字,在程序中引用你的视图控制器,你可以这样做:

UIStoryboard *us = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil];
FirstViewController *fvc = [storyboard instantiateViewControllerWithIdentifier:@"firstview"];

这行得通,如果你有任何问题,请告诉我。

【讨论】:

  • 好的,在一个新项目中它运行良好。我认为这是一个 xcode 错误。
猜你喜欢
  • 2013-03-20
  • 1970-01-01
  • 1970-01-01
  • 2016-09-13
  • 1970-01-01
  • 2014-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多