[英]How do I give an “identifier” to a view controller within my storyboard?
The instantiateViewControllerWithIdentifier:
method requires that the view controller I pass have an identifier. instantiateViewControllerWithIdentifier:
方法要求我传递的视图控制器具有标识符。 I went to my storyboard and clicked on my view controller, but I see no option to set the identifier. 我去了我的故事板并点击了我的视图控制器,但我看不到设置标识符的选项。 Where exactly do I find this option? 我在哪里找到这个选项?
As the Image suggests! 正如图像所示! Hope it helps! 希望能帮助到你!
Then to use it you call: 然后使用它你打电话:
[self.storyboard instantiateViewControllerWithIdentifier:@"YourViewControllerID"];
In the identity inspector there is a field Storyboard ID . 在身份检查器中有一个字段故事板ID 。 You could enter the class name here and then use this identifier in instantiateViewControllerWithIdentifier:
. 您可以在此处输入类名,然后在instantiateViewControllerWithIdentifier:
使用此标识符instantiateViewControllerWithIdentifier:
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.