2

有谁知道如何将 Storyboard 中的 UIViewControllers 与标识符连接起来?它似乎不再工作了..

4

1 回答 1

5

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.

于 2012-09-19T23:29:33.200 回答