How to assign an identifier to a UIViewController from the MainStoryboard?

…衆ロ難τιáo~ 提交于 2019-12-14 03:58:46

问题


Before I used to allocate and initialize a view controller using initWithNibName, where the parameter for the Nib name is simply the name of the xib/nib file.

However, with the way Xcode/IB works with Storyboards now, I'm not sure what I need to do to initialize a view controller class with it's respective xib/nib.

In my storyboard i have created the view controller and referenced it (from another view controller) and specified it as a Popover type.

Any ideas how this is accomplished?

Thanks.

* Update *

Apple docs says

To identify a specific view controller or segue inside a storyboard, use Interface Builder to assign it an identifier string that uniquely identifies it.

But I can't figure out how to assign a unique id via IB. How to do this?


回答1:


XCode 4.4 and earlier: Identifier; 
XCode 4.5: Storyboard ID 

STORYBOARD - doesn't contain a view controller with identifier



来源:https://stackoverflow.com/questions/11744106/how-to-assign-an-identifier-to-a-uiviewcontroller-from-the-mainstoryboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!