简体   繁体   中英

iOS6: How to connect UIViewController in Storyboard via Identifier?

Does anyone already know how to connect UIViewControllers in Storyboard with the identifier? It does not seem to work anymore..

Select the UIViewController, once u see a highlighted UIView (usually blue color) then go to the left most column on the XCODE. Select the Attribute inspector , you will see "Title" and "Identifier" label in the "View Controller" section. Give any name to it and in the program to refer to your view controller you can do something like this:

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

This works , let me know if u have any issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM