How to assign an identifier to a UIViewController

2019-08-07 05:08发布

问题:

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