Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
该instantiateViewControllerWithIdentifier:方法要求我传递的视图控制器具有标识符。我去了我的故事板并单击了我的视图控制器,但我看不到设置标识符的选项。我究竟在哪里可以找到这个选项?
instantiateViewControllerWithIdentifier:
如图所示!希望能帮助到你!
然后使用它你调用:
[self.storyboard instantiateViewControllerWithIdentifier:@"YourViewControllerID"];
针对 XCode 8 和 Swift 3 进行了更新。
instantiateViewControllerWithIdentifier现在是instantiateViewController(withIdentifier:)。
instantiateViewControllerWithIdentifier
设置情节提要 ID:
在身份检查器中有一个字段Storyboard ID。您可以在此处输入类名,然后在instantiateViewControllerWithIdentifier:.